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

Laurent Aimar fenrir at via.ecp.fr
Sat Nov 1 16:41:43 CET 2008


On Thu, Oct 30, 2008, davidf+nntp at woaf.net wrote:
> @@ -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 it is fine, a better way would probably be to change the PES code in
such a way that it does not depend on codec check.

-- 
fenrir



More information about the vlc-devel mailing list