From f982feb1d9251d79cb550687fc9d878c67b91089 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 23 Apr 2014 10:42:45 +0200 Subject: [PATCH] mpegpsdemux: Flush program end code bytes This should not harm regular files, since those are the last 4 bytes of a normal file. This allows to handle playback of concatenated mpeg-ps files. Seeking and duration reporting is still wrong though. --- gst/mpegdemux/gstmpegdemux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c index 78a2623390..b360dc1616 100644 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -3160,6 +3160,9 @@ gst_flups_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) ret = gst_flups_demux_parse_sys_head (demux); break; case ID_PS_END_CODE: + /* Skip final 4 bytes */ + gst_adapter_flush (demux->adapter, 4); + ADAPTER_OFFSET_FLUSH (4); ret = GST_FLOW_OK; goto done; case ID_PS_PROGRAM_STREAM_MAP: