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.
This commit is contained in:
Tim-Philipp Müller 2011-09-22 20:11:21 +01:00
parent 76dccf91fd
commit ad1883f54d

View file

@ -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 */