[vlc-devel] [PATCH 19/24] [mux/ts] Add signalling for larger stream_id

davidf+nntp at woaf.net davidf+nntp at woaf.net
Thu Oct 30 12:29:48 CET 2008


From: David Flynn <davidf at rd.bbc.co.uk>

Actually i think we should drop this / addto the don't care list

Signed-off-by: David Flynn <davidf at rd.bbc.co.uk>
---
 modules/mux/mpeg/pes.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/modules/mux/mpeg/pes.c b/modules/mux/mpeg/pes.c
index 3b034f1..14bdc8e 100644
--- a/modules/mux/mpeg/pes.c
+++ b/modules/mux/mpeg/pes.c
@@ -130,7 +130,12 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
                 bits_write( &bits, 1, 0x00 ); // dsm trick mode flag
                 bits_write( &bits, 1, 0x00 ); // additional copy info flag
                 bits_write( &bits, 1, 0x00 ); // pes crc flag
-                bits_write( &bits, 1, 0x00 ); // pes extension flags
+                if (p_fmt->i_codec == VLC_FOURCC('d','r','a','c')) {
+                    bits_write( &bits, 1, 0x01 ); // pes extension flags
+                    i_header_size += 1 + 1 + 1;;
+                }
+                else
+                    bits_write( &bits, 1, 0x00 ); // pes extension flags
                 bits_write( &bits, 8, i_header_size ); // header size -> pts and dts
 
                 /* write pts */
@@ -157,6 +162,20 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
                     bits_write( &bits, 1, 0x01 ); // marker
                     i_header_size -= 0x5;
                 }
+                if (p_fmt->i_codec == VLC_FOURCC('d','r','a','c')) {
+                    bits_write( &bits, 1, 0x00 ); // PES_private_data_flag
+                    bits_write( &bits, 1, 0x00 ); // pack_header_field_flag
+                    bits_write( &bits, 1, 0x00 ); // program_packet_sequence_counter_flag
+                    bits_write( &bits, 1, 0x00 ); // P-STD_buffer_flag
+                    bits_write( &bits, 3, 0x07 ); // reserved
+                    bits_write( &bits, 1, 0x01 ); // PES_extension_flag_2
+                    /* PES_extension_2 */
+                    bits_write( &bits, 1, 0x01 ); // marker
+                    bits_write( &bits, 7, 0x01 ); // PES_extension_field_length
+                    bits_write( &bits, 1, 0x01 ); // stream_id_extension_flag
+                    bits_write( &bits, 7, 0x60 ); // stream_id_extension
+                    i_header_size -= 0x3;
+                }
                 while ( i_header_size )
                 {
                     bits_write( &bits, 8, 0xff );
-- 
1.5.6.5




More information about the vlc-devel mailing list