diff options
author | Edward Hervey <bilboed@bilboed.com> | 2014-10-08 14:09:59 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2015-02-18 12:17:30 +0100 |
commit | 87070a08bd014698d6a579d2e1cc9c9463e1f5ec (patch) | |
tree | 93f39ba80f5e5337b77da9966115494855cd9a28 | |
parent | 735c6c40f826c3e4d0bd652f4f0d48243d4a5b24 (diff) |
qtdemux: don't blindly use any previous buffer timestamp for moof
The previous PTS might actually be from quite far away, from way before
the moof header. We don't want to use that blindly.
Use a safety distance of 4kbytes instead
Avoids using completely bogus base timestamp for fragments
-rw-r--r-- | gst/isomp4/qtdemux.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 61dd18b86..b32385929 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -5195,8 +5195,9 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force) */ prev_pts = gst_adapter_prev_pts (demux->adapter, &dist); prev_offset = demux->offset - dist; - if (demux->fragment_start_offset == -1 - || prev_offset > demux->fragment_start_offset) { + /* safeguard with 4k distance */ + if (dist < 4096 && (demux->fragment_start_offset == -1 + || prev_offset > demux->fragment_start_offset)) { demux->fragment_start_offset = prev_offset; demux->fragment_start = prev_pts; GST_DEBUG_OBJECT (demux, |