summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <ts.santos@sisa.samsung.com>2014-04-29 18:14:29 -0300
committerThiago Santos <ts.santos@sisa.samsung.com>2014-04-29 18:49:15 -0300
commitbb8887baa79cfb74eec435ba2ef0bdc07a847947 (patch)
treefd43ec53a3bd79d25efc8b07170c1e64f9cd6efa
parent4ab1d9f21f7be039971ae0508953d910be9096e3 (diff)
hlsdemux: flush the adapter in the end of a fragment
In case of error there might be some data left in the adapter when EOS is received. Clear the adapter to be able to restart again later if requested.
-rw-r--r--ext/hls/gsthlsdemux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c
index 5a98b5e16..b7ef8ac92 100644
--- a/ext/hls/gsthlsdemux.c
+++ b/ext/hls/gsthlsdemux.c
@@ -943,7 +943,12 @@ _src_event (GstPad * pad, GstObject * parent, GstEvent * event)
case GST_EVENT_EOS:
if (demux->current_key)
gst_hls_demux_decrypt_end (demux);
- /* TODO adapter should be empty */
+
+ /* ideally this should be empty, but this eos might have been
+ * caused by an error on the source element */
+ GST_DEBUG_OBJECT (demux, "Data still on the adapter when EOS was received"
+ ": %" G_GSIZE_FORMAT, gst_adapter_available (demux->adapter));
+ gst_adapter_clear (demux->adapter);
/* pending buffer is only used for encrypted streams */
if (demux->pending_buffer) {