- id->p_es = malloc( sizeof( es_descriptor_t ) );
- memset( id->p_es, 0, sizeof( es_descriptor_t ) );
- id->p_es->i_cat = p_fmt->i_cat;
- id->p_es->i_fourcc = p_fmt->i_codec;
- id->p_es->b_force_decoder = VLC_TRUE;
- es_format_Copy( &id->p_es->fmt, p_fmt );
+ if( p_sys->i_es == 0 )
+ {
+ p_sys->p_input = vlc_object_find( p_stream, VLC_OBJECT_INPUT,
+ FIND_PARENT );
+ if( p_sys->p_input == NULL )
+ {
+ msg_Err( p_stream, "cannot find input" );
+ free( id );
+ return NULL;
+ }
+ }