From ad1883f54d100e0bb2d6aa6ec3463accc6cc26cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 22 Sep 2011 20:11:21 +0100 Subject: [PATCH] psmux: fix writing of system header, which makes VLC not skip the adjacent PSM and play embedded H.264 streams header_length contains the length in bytes after the header_length field, excluding the 6 byte start code and header_length field. H.264 streams and some other formats need to be announced in the PSM. VLC wouldn't play files created with mpegpsmux containing H.264 because we claim the system header is larger than it actually is, which makes VLC skip the program stream map which follows the system header, which in turn makes it not recognise our H.264 video stream. --- gst/mpegpsmux/psmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/mpegpsmux/psmux.c b/gst/mpegpsmux/psmux.c index 9d0493c1d9..0a714d038a 100644 --- a/gst/mpegpsmux/psmux.c +++ b/gst/mpegpsmux/psmux.c @@ -348,7 +348,7 @@ psmux_write_system_header (PsMux * mux) bits_write (&bw, 24, PSMUX_START_CODE_PREFIX); bits_write (&bw, 8, PSMUX_SYSTEM_HEADER); - bits_write (&bw, 16, len); /* header_length */ + bits_write (&bw, 16, len - 6); /* header_length (bytes after this field) */ bits_write (&bw, 1, 1); /* marker */ bits_write (&bw, 22, mux->rate_bound); /* rate_bound */ bits_write (&bw, 1, 1); /* marker */