]> git.sesse.net Git - vlc/blobdiff - modules/demux/mpeg/m4v.c
* modules/demux/mpeg/m4v.c,h264.c: fixed detection and use p_demux->b_force.
[vlc] / modules / demux / mpeg / m4v.c
index 4cbd185057420b33cc170d61aa0576e9acebdff5..2be0fb177bdc925eb60547f2209478fe7a4bfe5b 100644 (file)
@@ -69,30 +69,20 @@ static int Open( vlc_object_t * p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    vlc_bool_t   b_forced = VLC_FALSE;
     uint8_t     *p_peek;
 
-    if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 )
-    {
-        msg_Err( p_demux, "cannot peek" );
-        return VLC_EGENERIC;
-    }
-
-    if( !strncmp( p_demux->psz_demux, "mp4v", 4 ) ||
-        !strncmp( p_demux->psz_demux, "m4v", 4 ) )
-    {
-        b_forced = VLC_TRUE;
-    }
+    if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
 
-    if( p_peek[0] != 0x00 || p_peek[1] != 0x00 || p_peek[2] != 0x01 || p_peek[3] > 0x2f )
+    if( p_peek[0] != 0x00 || p_peek[1] != 0x00 || p_peek[2] != 0x01 )
     {
-        if( !b_forced )
+        if( !p_demux->b_force )
         {
             msg_Warn( p_demux, "m4v module discarded (no startcode)" );
             return VLC_EGENERIC;
         }
 
-        msg_Warn( p_demux, "this doesn't look like an MPEG-4 ES stream, continuing anyway" );
+        msg_Warn( p_demux, "this doesn't look like an MPEG-4 ES stream, "
+                  "continuing anyway" );
     }
 
     p_demux->pf_demux  = Demux;
@@ -107,7 +97,7 @@ static int Open( vlc_object_t * p_this )
 
     LOAD_PACKETIZER_OR_FAIL( p_sys->p_packetizer, "mpeg4 video" );
 
-    /* We need to wait until we gtt p_extra (VOL header) from the packetizer
+    /* We need to wait until we get p_extra (VOL header) from the packetizer
      * before we create the output */
 
     return VLC_SUCCESS;