return VLC_EGENERIC;
}
valid:
- /* Set p_input field */
- p_demux->pf_demux = Demux;
- p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
if( !p_sys )
return VLC_ENOMEM;
/* override presets if yuv4mpeg2 */
if( b_y4m )
{
+ /* The string should start with "YUV4MPEG2" */
char *psz = stream_ReadLine( p_demux->s );
char *psz_buf;
int a = 1;
int b = 1;
- /* The string will start with "YUV4MPEG2" */
- assert( strlen(psz) >= 9 );
+ if( unlikely(psz == NULL) )
+ goto error;
/* NB, it is not possible to handle interlaced here, since the
* interlaced picture flags are in picture_t not block_t */
}
es_format_Init( &p_sys->fmt_video, VIDEO_ES, i_chroma );
- video_format_Setup( &p_sys->fmt_video.video,
- i_chroma, i_width, i_height,
+ video_format_Setup( &p_sys->fmt_video.video, i_chroma,
+ i_width, i_height, i_width, i_height,
i_sar_num, i_sar_den );
vlc_ureduce( &p_sys->fmt_video.video.i_frame_rate,
* p_sys->fmt_video.video.i_bits_per_pixel / 8;
p_sys->p_es_video = es_out_Add( p_demux->out, &p_sys->fmt_video );
+ p_demux->pf_demux = Demux;
+ p_demux->pf_control = Control;
return VLC_SUCCESS;
error: