* src/misc/modules.c: only set b_force when we have b_strict.
* src/input/demux.c: add m4v and h264 extensions.
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
- vlc_bool_t b_forced = VLC_FALSE;
-
uint8_t *p_peek;
vlc_value_t val;
- if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 )
- {
- msg_Err( p_demux, "cannot peek" );
- return VLC_EGENERIC;
- }
-
- if( !strncmp( p_demux->psz_demux, "h264", 4 ) )
- {
- b_forced = VLC_TRUE;
- }
+ if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC;
if( p_peek[0] != 0x00 || p_peek[1] != 0x00 ||
p_peek[2] != 0x00 || p_peek[3] != 0x01 ||
(p_peek[4]&0x1F) != 7 ) /* SPS */
{
- if( !b_forced )
+ if( !p_demux->b_force )
{
msg_Warn( p_demux, "h264 module discarded (no startcode)" );
return VLC_EGENERIC;
}
- msg_Err( p_demux, "this doesn't look like a H264 ES stream, continuing" );
+ msg_Err( p_demux, "this doesn't look like a H264 ES stream, "
+ "continuing anyway" );
}
p_demux->pf_demux = Demux;
var_Create( p_demux, "h264-fps", VLC_VAR_FLOAT|VLC_VAR_DOINHERIT );
var_Get( p_demux, "h264-fps", &val );
p_sys->f_fps = val.f_float;
- if( val.f_float < 0.001 )
- {
- p_sys->f_fps = 0.001;
- }
+ if( val.f_float < 0.001 ) p_sys->f_fps = 0.001;
msg_Dbg( p_demux, "using %.2f fps", p_sys->f_fps );
/* Load the mpegvideo packetizer */
{
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;
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;
{ "ogg", "ogg" }, { "ogm", "ogg" },
{ "pva", "pva" },
{ "rm", "rm" },
+ { "m4v", "m4v" },
+ { "h264", "h264" },
{ NULL, NULL },
};
/* Here, we don't mind if it does not work, it must be quick */
/* Store this new module */
p_list[ i_index ].p_module = p_module;
p_list[ i_index ].i_score = p_module->i_score + i_shortcut_bonus;
- p_list[ i_index ].b_force = !!i_shortcut_bonus;
+ p_list[ i_index ].b_force = i_shortcut_bonus && b_strict;
/* Add it to the modules-to-probe list */
if( i_index == 0 )