diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-04-10 18:46:01 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-05-08 18:08:05 +0200 |
commit | 979b70a9830c755151f568c9e3a895a8757123e7 (patch) | |
tree | 26318363d319b3175f1a7108de2f2e7c48736c9e | |
parent | e2a5fb79e02235bbcaa1818a814fafba9eda9ffd (diff) | |
download | gstreamer-plugins-bad-979b70a9830c755151f568c9e3a895a8757123e7.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.
-rw-r--r-- | ext/dash/gstdashdemux.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 271f70fd2..93c5d2532 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -2614,10 +2614,15 @@ gst_dash_demux_data_received (GstAdaptiveDemux * demux, sidx_end_offset - dash_stream->sidx_current_offset); } } 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; + } } } |