]> git.sesse.net Git - vlc/blobdiff - modules/mux/mpeg/pes.c
Used VLC_CODEC_* and i_original_fourcc when applicable.
[vlc] / modules / mux / mpeg / pes.c
index a8a31029b029b047fb0b092f9a0b52974d2bc377..7df2891ee8570cedfd443c49e6c47c97a79357c9 100644 (file)
 # include "config.h"
 #endif
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <fcntl.h>
-
 #include <vlc_common.h>
 #include <vlc_sout.h>
 #include <vlc_block.h>
-
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
+#include <assert.h>
 
 #include <vlc_codecs.h>
 #include "pes.h"
@@ -119,7 +111,7 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
 
                 if( i_pts > 0 && i_dts > 0 &&
                     ( i_pts != i_dts || ( p_fmt->i_cat == VIDEO_ES &&
-                      p_fmt->i_codec != VLC_FOURCC('m','p','g','v') ) ) )
+                      p_fmt->i_codec != VLC_CODEC_MPGV ) ) )
                 {
                     i_pts_dts = 0x03;
                     if ( !i_header_size ) i_header_size = 0xa;
@@ -135,7 +127,7 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
                     if ( !i_header_size ) i_header_size = 0x0;
                 }
 
-                if( i_stream_id == 0xfd )
+                if( i_stream_id == PES_EXTENDED_STREAM_ID )
                 {
                     b_pes_extension_flag = true;
                     i_header_size += 1 + 1;
@@ -206,7 +198,7 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
                     /*   pack_header */
                     /*   program_packet_sequence_counter */
                     /*   P-STD_buffer_flag */
-                    if( i_stream_id == 0xfd )
+                    if( i_stream_id == PES_EXTENDED_STREAM_ID )
                     {
                         /* PES_extension_2 */
                         bits_write( &bits, 1, 0x01 ); // marker
@@ -349,7 +341,7 @@ int  EStoPES ( sout_instance_t *p_sout, block_t **pp_pes, block_t *p_es,
         i_max_pes_size = PES_PAYLOAD_SIZE_MAX;
     }
 
-    if( p_fmt->i_codec == VLC_FOURCC( 'm', 'p','4', 'v' ) &&
+    if( p_fmt->i_codec == VLC_CODEC_MP4V &&
         p_es->i_flags & BLOCK_FLAG_TYPE_I )
     {
         /* For MPEG4 video, add VOL before I-frames */