vlc_module_begin();
set_capability( "decoder", 40 );
+ set_shortname( N_("USFSubs"));
+ set_description( N_("USF subtitles decoder") );
set_callbacks( OpenDecoder, CloseDecoder );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_SCODEC );
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)calloc(1, sizeof(decoder_sys_t)) ) == NULL )
{
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
}
****************************************************************************/
static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
- subpicture_t *p_spu = NULL;
+ subpicture_t *p_spu;
+ block_t *p_block;
+
+ if( !pp_block || *pp_block == NULL )
+ return NULL;
- if( !pp_block || *pp_block == NULL ) return NULL;
+ p_block = *pp_block;
+ if( p_block->i_rate != 0 )
+ p_block->i_length = p_block->i_length * p_block->i_rate / INPUT_RATE_DEFAULT;
- p_spu = ParseText( p_dec, *pp_block );
+ p_spu = ParseText( p_dec, p_block );
- block_Release( *pp_block );
+ block_Release( p_block );
*pp_block = NULL;
return p_spu;
continue;
if( p_sys->pp_images[i]->p_pic )
- p_sys->pp_images[i]->p_pic->pf_release( p_sys->pp_images[i]->p_pic );
+ picture_Release( p_sys->pp_images[i]->p_pic );
free( p_sys->pp_images[i]->psz_filename );
free( p_sys->pp_images[i] );
p_text_region->psz_html = strndup( psz_subtitle, i_len );
if( ! p_text_region->psz_html )
{
- msg_Err( p_dec, "out of memory" );
p_spu->pf_destroy_region( VLC_OBJECT(p_dec), p_text_region );
return NULL;
}
p_style = calloc( 1, sizeof(ssa_style_t) );
if( ! p_style )
{
- msg_Err( p_dec, "out of memory" );
free( psz_node );
break;
}