diff options
author | Edward Hervey <bilboed@bilboed.com> | 2014-10-08 14:09:59 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2014-10-27 09:43:52 +0100 |
commit | 0911e76bd21f272d435f36e66ad5822628c1689c (patch) | |
tree | 727d9badf4ac0aeeb44c3383c77bf989d156dc07 | |
parent | 471d6bf1835f5536790a766fd3194b7d014deb04 (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 be01e41d2..12ab815c3 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -4838,8 +4838,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, |