qtdemux: extend edit list when fragmented

When we are fragmented, the edit list may only refer to the portion of
the media that is in the moov.  Extend the edit list stop time when we
if there is only one qt segment and we are reading a fragmented file.

Fixes playback of some fragmented mp4 files generated by proprietary
programs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/643>
This commit is contained in:
Matthew Waters 2020-06-25 16:30:28 +10:00
parent 64e89e43aa
commit 2b9c465643

View file

@ -3129,7 +3129,10 @@ check_update_duration (GstQTDemux * qtdemux, GstClockTime duration)
/* internal duration tracking state has been updated above, so */
/* preserve an open-ended dummy segment rather than repeatedly updating
* it and spamming downstream accordingly with segment events */
if (stream->dummy_segment &&
/* also mangle the edit list end time when fragmented with a single edit
* list that may only cover any non-fragmented data */
if ((stream->dummy_segment ||
(qtdemux->fragmented && stream->n_segments == 1)) &&
GST_CLOCK_TIME_IS_VALID (stream->segments[0].duration)) {
/* Update all dummy values to new duration */
stream->segments[0].stop_time = duration;