tsdemux: Flush out pending data on EOS

Ensures downstream elements (like decoders) really get all the data
This commit is contained in:
Edward Hervey 2013-07-29 08:20:10 +02:00
parent ca77865bce
commit a76c658e8d

View file

@ -596,6 +596,11 @@ push_event (MpegTSBase * base, GstEvent * event)
for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) { for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) {
TSDemuxStream *stream = (TSDemuxStream *) tmp->data; TSDemuxStream *stream = (TSDemuxStream *) tmp->data;
if (stream->pad) { if (stream->pad) {
/* If we are pushing out EOS, flush out pending data first */
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS && stream->active &&
gst_pad_is_active (stream->pad))
gst_ts_demux_push_pending_data (demux, stream);
gst_event_ref (event); gst_event_ref (event);
gst_pad_push_event (stream->pad, event); gst_pad_push_event (stream->pad, event);
} }