]> git.sesse.net Git - vlc/blobdiff - modules/demux/ps.c
Atmo: remove misleading comment about vlc_object_find()
[vlc] / modules / demux / ps.c
index ffab1e7e0c0a498768c21d178cbf453f4d407447..0b0227529c9f2df41d0cf2a9ea45367909bcc294 100644 (file)
@@ -61,7 +61,7 @@ vlc_module_begin ()
     set_callbacks( OpenForce, Close )
     add_shortcut( "ps" )
 
-    add_bool( "ps-trust-timestamps", true, NULL, TIME_TEXT,
+    add_bool( "ps-trust-timestamps", true, TIME_TEXT,
                  TIME_LONGTEXT, true )
         change_safe ()
 
@@ -240,7 +240,7 @@ static void FindLength( demux_t *p_demux )
     int64_t i_current_pos = -1, i_size = 0, i_end = 0;
     int i;
 
-    if( !var_CreateGetInteger( p_demux, "ps-trust-timestamps" ) )
+    if( !var_CreateGetBool( p_demux, "ps-trust-timestamps" ) )
         return;
 
     if( p_sys->i_length == -1 ) /* First time */
@@ -391,8 +391,8 @@ static int Demux( demux_t *p_demux )
             /* The popular VCD/SVCD subtitling WinSubMux does not
              * renumber the SCRs when merging subtitles into the PES */
             if( tk->b_seen &&
-                ( tk->fmt.i_codec == VLC_FOURCC('o','g','t',' ') ||
-                  tk->fmt.i_codec == VLC_FOURCC('c','v','d',' ') ) )
+                ( tk->fmt.i_codec == VLC_CODEC_OGT ||
+                  tk->fmt.i_codec == VLC_CODEC_CVD ) )
             {
                 p_sys->i_scr = -1;
             }
@@ -581,16 +581,12 @@ static int ps_pkt_resynch( stream_t *s, uint32_t *pi_code )
 static block_t *ps_pkt_read( stream_t *s, uint32_t i_code )
 {
     const uint8_t *p_peek;
-    int      i_peek = stream_Peek( s, &p_peek, 14 );
-    int      i_size;
-    VLC_UNUSED(i_code);
-
-    /* Smallest valid packet */
-    if( i_peek < 6 ) return NULL;
+    int i_peek = stream_Peek( s, &p_peek, 14 );
+    if( i_peek < 4 )
+        return NULL;
 
-    i_size = ps_pkt_size( p_peek, i_peek );
-
-    if( i_size < 0 || ( i_size <= 6 && p_peek[3] > 0xba ) )
+    int i_size = ps_pkt_size( p_peek, i_peek );
+    if( i_size <= 6 && p_peek[3] > 0xba )
     {
         /* Special case, search the next start code */
         i_size = 6;
@@ -618,5 +614,6 @@ static block_t *ps_pkt_read( stream_t *s, uint32_t i_code )
         return stream_Block( s, i_size );
     }
 
+    VLC_UNUSED(i_code);
     return NULL;
 }