From a76c658e8d5fa1b533b0d54a947db50a29d9b369 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 29 Jul 2013 08:20:10 +0200 Subject: [PATCH] tsdemux: Flush out pending data on EOS Ensures downstream elements (like decoders) really get all the data --- gst/mpegtsdemux/tsdemux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 21b2d3f..5411811 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -596,6 +596,11 @@ push_event (MpegTSBase * base, GstEvent * event) for (tmp = demux->program->stream_list; tmp; tmp = tmp->next) { TSDemuxStream *stream = (TSDemuxStream *) tmp->data; 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_pad_push_event (stream->pad, event); } -- 2.7.4