From 4523cff1472bedeb3221a470c3f76fb7c24a6f7e Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 23 Dec 2016 15:41:57 +0900 Subject: [PATCH] dashdemux: Add first_offset of sidx box to base offset sidx has "first_offset" syntax which represents the distance in bytes from anchor point to media fragment. If present, we should adjust sidx_base_offset. https://bugzilla.gnome.org/show_bug.cgi?id=776431 --- ext/dash/gstdashdemux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index d99691af9d..f6f812f6ba 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -2172,6 +2172,13 @@ gst_dash_demux_parse_isobmff (GstAdaptiveDemux * demux, &dummy); if (res == GST_ISOFF_PARSER_DONE) { + guint64 first_offset = dash_stream->sidx_parser.sidx.first_offset; + if (first_offset) { + GST_LOG_OBJECT (stream->pad, + "non-zero sidx first offset %" G_GUINT64_FORMAT, first_offset); + dash_stream->sidx_base_offset += first_offset; + } + if (GST_CLOCK_TIME_IS_VALID (dash_stream->pending_seek_ts)) { /* FIXME, preserve seek flags */ gst_dash_demux_stream_sidx_seek (dash_stream,