Skip to content

Commit a38e31b

Browse files
asurdej-comcastphiln
authored andcommitted
[GStreamer] Fix negative timestamps handling (edit lists)
Bring back negative timestamps clamp on conversion to gst time that was removed by WebRTC related backports from upstream: 95cae32 The part of code comes from Edit list support patch that is entirely reverted upstream. This fixes YT MSE Codec Tests 84.BufUnbufSeekH264
1 parent b907bcc commit a38e31b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ uint64_t toGstUnsigned64Time(const MediaTime&);
8181

8282
inline GstClockTime toGstClockTime(const MediaTime& mediaTime)
8383
{
84+
if (mediaTime.isInvalid())
85+
return GST_CLOCK_TIME_NONE;
86+
if (mediaTime < MediaTime::zeroTime())
87+
return 0;
8488
return static_cast<GstClockTime>(toGstUnsigned64Time(mediaTime));
8589
}
8690

0 commit comments

Comments
 (0)