1
0

Fix MSC divergence: duration should be clamped, not ignored if high

This commit is contained in:
Olivier 'reivilibre
2025-12-18 14:15:27 +00:00
parent 375ebb5ffc
commit ad3d66f23a
+2 -6
View File
@@ -329,12 +329,8 @@ class EventBase(metaclass=abc.ABCMeta):
return None
sticky_duration_ms = sticky_obj.get("duration_ms", None)
# MSC: Valid values are the integer range 0-MAX_DURATION_MS
if (
type(sticky_duration_ms) is int
and sticky_duration_ms >= 0
and sticky_duration_ms <= StickyEvent.MAX_DURATION_MS
):
return sticky_duration_ms
if type(sticky_duration_ms) is int and sticky_duration_ms >= 0:
return min(sticky_duration_ms, StickyEvent.MAX_DURATION_MS)
return None
def __str__(self) -> str: