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.
This commit is contained in:
Thiago Santos 2014-04-29 18:14:29 -03:00
parent 4ab1d9f21f
commit bb8887baa7

View file

@ -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) {