set_callbacks( OpenDecoder, CloseDecoder )
add_shortcut( "invmem" )
- add_integer( "invmem-width", "0", NULL, T_WIDTH, LT_WIDTH, false )
- add_integer( "invmem-height", "0", NULL, T_HEIGHT, LT_HEIGHT, false )
+ add_integer( "invmem-width", 0, NULL, T_WIDTH, LT_WIDTH, false )
+ add_integer( "invmem-height", 0, NULL, T_HEIGHT, LT_HEIGHT, false )
add_string( "invmem-lock", "0", NULL, T_LOCK, LT_LOCK, true )
add_string( "invmem-unlock", "0", NULL, T_UNLOCK, LT_UNLOCK, true )
add_string( "invmem-data", "0", NULL, T_DATA, LT_DATA, true )
}
/* Allocate the memory needed to store the decoder's structure */
- if( ( p_dec->p_sys = p_sys =
- (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
+ if( ( p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t)) ) == NULL )
return VLC_ENOMEM;
// get parametrs
p_sys->i_width = var_CreateGetInteger( p_this, "invmem-width" );
p_sys->i_height = var_CreateGetInteger( p_this, "invmem-height" );
- if (p_sys->i_width == 0 || p_sys->i_height == 0) {
- msg_Err( p_dec, "--vmem-width and --vmem-height must be > 0" );
+ if( p_sys->i_width == 0 || p_sys->i_height == 0 )
+ {
+ msg_Err( p_dec, "--invmem-width and --invmem-height must be > 0" );
+ free( p_sys );
return VLC_EGENERIC;
}
if( !p_sys->pf_lock || !p_sys->pf_unlock )
{
msg_Err( p_dec, "Invalid lock or unlock callbacks" );
+ free( p_sys );
return VLC_EGENERIC;
}
if( p_sys->p_pic != NULL )
picture_Release( p_sys->p_pic );
p_sys->p_pic = decoder_NewPicture( p_dec );
- p_sys->p_pic = p_dec->pf_vout_buffer_new( p_dec );
p_sys->p_pic->b_force = true;
p_sys->p_pic->p->i_pitch = p_dec->p_sys->i_pitch;
p_sys->p_pic->date = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;