summaryrefslogtreecommitdiff
path: root/ext/dash
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-04-10 18:46:01 +0300
committerSebastian Dröge <sebastian@centricular.com>2017-04-10 18:46:01 +0300
commit67778ac55ec125f905970d44477a8b7ff2e43619 (patch)
treedf371805de8d47af4db8f022131fbbc8be74a917 /ext/dash
parentfc0c7d664d546a3b545e7c5b7bed392ea07babbf (diff)
downloadgstreamer-plugins-bad-67778ac55ec125f905970d44477a8b7ff2e43619.tar.gz
dashdemux: Handle current SIDX before current position in normal mode like in keyunit-only trick mode
Otherwise we'll get into an infinite loop here. Now this is still not correct and will cause a clean error, but at least it won't hang forever anymore.
Diffstat (limited to 'ext/dash')
-rw-r--r--ext/dash/gstdashdemux.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index 93e19000f..fe9106182 100644
--- a/ext/dash/gstdashdemux.c
+++ b/ext/dash/gstdashdemux.c
@@ -2866,10 +2866,15 @@ gst_dash_demux_data_received (GstAdaptiveDemux * demux,
buffer =
gst_adapter_take_buffer (dash_stream->sidx_adapter, available);
} else {
- buffer =
- gst_adapter_take_buffer (dash_stream->sidx_adapter,
- sidx_end_offset - dash_stream->sidx_current_offset);
- advance = TRUE;
+ if (sidx_end_offset <= dash_stream->sidx_current_offset) {
+ buffer = NULL;
+ gst_adapter_clear (dash_stream->sidx_adapter);
+ } else {
+ buffer =
+ gst_adapter_take_buffer (dash_stream->sidx_adapter,
+ sidx_end_offset - dash_stream->sidx_current_offset);
+ advance = TRUE;
+ }
}
}