From 5536bcf8b83e08499cf948a93753f688b8e19572 Mon Sep 17 00:00:00 2001 From: Julian Scheel Date: Wed, 16 May 2012 16:15:58 +0200 Subject: [PATCH] tsdemux: flush on pusi only for payload packets Data should not be flushed out of the tsdemux because a payload unit start indicator (pusi) is seen in a adaptation only ts packet. If the package contains no payload a pusi does not indicate a new PES packet, but PSI information, etc. This fixes playback of several TS files which contain ts packets without payload but with pusi set to 1. https://bugzilla.gnome.org/show_bug.cgi?id=676168 --- gst/mpegtsdemux/tsdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 037ce0495c..39106a3846 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1572,7 +1572,8 @@ gst_ts_demux_handle_packet (GstTSDemux * demux, TSDemuxStream * stream, return res; } - if (G_UNLIKELY (packet->payload_unit_start_indicator)) + if (G_UNLIKELY (packet->payload_unit_start_indicator) && + packet->adaptation_field_control & 0x1) /* Flush previous data */ res = gst_ts_demux_push_pending_data (demux, stream);