From f38f30ed83b23617bdcf95a934c217eb25771d40 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 30 May 2016 12:26:16 +0200 Subject: qtdemux: Fix usage of gst_adapter_get_offset() In order to be backwards compatible with previous behaviour, make sure we don't end up using invalid offsets from the adapter --- gst/isomp4/qtdemux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index efd096052..9ea365c56 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -6346,9 +6346,11 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force) "demux offset %" G_GUINT64_FORMAT " adapter offset %" G_GUINT64_FORMAT, demux->offset, gst_adapter_get_offset (demux->adapter)); - if (demux->upstream_format_is_time) + if (demux->upstream_format_is_time) { demux->moof_offset = gst_adapter_get_offset (demux->adapter); - else + if (demux->moof_offset == GST_BUFFER_OFFSET_NONE) + demux->moof_offset = demux->offset; + } else demux->moof_offset = demux->offset; if (!qtdemux_parse_moof (demux, data, demux->neededbytes, demux->moof_offset, NULL)) { -- cgit v1.2.3