summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-03-15 13:24:57 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-03-15 13:27:23 +0200
commit141f3b2f4d6dfbaf481f5c87417109b20aae0f65 (patch)
treefd2656a3d9d20ab21e554fc4fcb49e8f276af309
parentb76a2200de345751c0a29c42a5630ed5572269d7 (diff)
downloadgstreamer-plugins-bad-141f3b2f4d6dfbaf481f5c87417109b20aae0f65.tar.gz
dashdemux: If a SIDX seek failed although we're in the correct segment, disable the SIDX usage for this segment
The SIDX apparently does not contain information about the current segment, so better stop using it instead of using incorrect values.
-rw-r--r--ext/dash/gstdashdemux.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index 1479b682c..1cc51f28f 100644
--- a/ext/dash/gstdashdemux.c
+++ b/ext/dash/gstdashdemux.c
@@ -1345,6 +1345,11 @@ gst_dash_demux_stream_seek (GstAdaptiveDemuxStream * stream, gboolean forward,
if (dashstream->sidx_parser.status == GST_ISOFF_SIDX_PARSER_FINISHED) {
gst_dash_demux_stream_sidx_seek (dashstream, forward, flags, ts,
final_ts);
+ if (SIDX (dashstream)->entry_index >= SIDX (dashstream)->entries_count) {
+ GST_ERROR_OBJECT (stream->pad, "Couldn't find position in sidx");
+ dashstream->sidx_parser.status = GST_ISOFF_PARSER_UNEXPECTED;
+ dashstream->sidx_position = GST_CLOCK_TIME_NONE;
+ }
} else {
/* no index yet, seek when we have it */
/* FIXME - the final_ts won't be correct here */
@@ -2279,6 +2284,12 @@ gst_dash_demux_parse_isobmff (GstAdaptiveDemux * demux,
/* FIXME, preserve seek flags */
gst_dash_demux_stream_sidx_seek (dash_stream,
demux->segment.rate >= 0, 0, dash_stream->pending_seek_ts, NULL);
+ if (SIDX (dash_stream)->entry_index >=
+ SIDX (dash_stream)->entries_count) {
+ GST_ERROR_OBJECT (stream->pad, "Couldn't find position in sidx");
+ dash_stream->sidx_parser.status = GST_ISOFF_PARSER_UNEXPECTED;
+ dash_stream->sidx_position = GST_CLOCK_TIME_NONE;
+ }
/* push buffer up to sidx box, and do pending stream seek */
break;
} else {
@@ -2757,6 +2768,12 @@ gst_dash_demux_data_received (GstAdaptiveDemux * demux,
demux->segment.rate >= 0, 0, dash_stream->pending_seek_ts,
NULL);
dash_stream->pending_seek_ts = GST_CLOCK_TIME_NONE;
+ if (SIDX (dash_stream)->entry_index >=
+ SIDX (dash_stream)->entries_count) {
+ GST_ERROR_OBJECT (stream->pad, "Couldn't find position in sidx");
+ dash_stream->sidx_parser.status = GST_ISOFF_PARSER_UNEXPECTED;
+ dash_stream->sidx_position = GST_CLOCK_TIME_NONE;
+ }
} else {
gint idx = 0;