]> git.sesse.net Git - vlc/blobdiff - modules/demux/ps.h
minor changes to JVLC class
[vlc] / modules / demux / ps.h
index 0b2fd4beca297234c15f4e88be28d7c9240345bb..accca9e35fbc1e2177e39adc2f8c986f8c02df1b 100644 (file)
@@ -101,6 +101,10 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id )
         {
             es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('c','v','d',' ') );
         }
+        else if( ( i_id&0xff ) == 0x10 )
+        {
+            es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('t','e','l','x') );
+        }
         else
         {
             es_format_Init( &tk->fmt, UNKNOWN_ES, 0 );
@@ -161,7 +165,7 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id )
     /* PES packets usually contain truncated frames */
     tk->fmt.b_packetized = VLC_FALSE;
 
-    if( ps_id_to_lang( p_psm , i_id ) )
+    if( ps_id_to_lang( p_psm, i_id ) )
     {
         tk->fmt.psz_language = malloc( 4 );
         memcpy( tk->fmt.psz_language, ps_id_to_lang( p_psm , i_id ), 3 );
@@ -242,7 +246,7 @@ static inline int ps_pkt_id( block_t *p_pkt )
 /* return the size of the next packet
  * XXX you need to give him at least 14 bytes (and it need to start as a
  * valid packet) */
-static inline int ps_pkt_size( uint8_t *p, int i_peek )
+static inline int ps_pkt_size( const uint8_t *p, int i_peek )
 {
     if( p[3] == 0xb9 && i_peek >= 4 )
     {
@@ -493,11 +497,10 @@ static inline void ps_psm_destroy( ps_psm_t *p_psm )
 {
     while( p_psm->i_es-- )
     {
-        if( p_psm->es[p_psm->i_es]->i_descriptor )
-            free( p_psm->es[p_psm->i_es]->p_descriptor );
+        free( p_psm->es[p_psm->i_es]->p_descriptor );
         free( p_psm->es[p_psm->i_es] );
     }
-    if( p_psm->es ) free( p_psm->es );
+    free( p_psm->es );
 
     p_psm->es = 0;
     p_psm->i_es = 0;