# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_osd.h>
}
p_dec->p_sys = p_sys = calloc( 1, sizeof( decoder_sys_t ) );
+ if( p_sys == NULL )
+ return VLC_ENOMEM;
+
p_sys->i_debug = config_GetInt( p_this, MODULE_STRING "-debug" );
p_sys->i_image = -1;
if( p_block->i_buffer < SPU_HEADER_LEN )
{
- msg_Dbg( p_dec, "invalid packet header (size %d < %d)" ,
+ msg_Dbg( p_dec, "invalid packet header (size %zu < %u)" ,
p_block->i_buffer, SPU_HEADER_LEN );
block_Release( p_block );
return NULL;
if( p_spu->i_buffer != p_sys->i_spu_size )
{
- msg_Warn( p_dec, "subtitle packets size=%d should be %d",
+ msg_Warn( p_dec, "subtitle packets size=%zu should be %zu",
p_spu->i_buffer, p_sys->i_spu_size );
}
dbg_print( (DECODE_DBG_PACKET),
- "subtitle packet complete, size=%d", p_spu->i_buffer );
+ "subtitle packet complete, size=%zu", p_spu->i_buffer );
p_sys->i_state = SUBTITLE_BLOCK_EMPTY;
p_sys->p_spu = 0;
if (p_sys && p_sys->i_debug & DECODE_DBG_PACKET)
{
msg_Dbg( p_dec, "x-start: %d, y-start: %d, width: %d, height %d, "
- "spu size: %d, duration: %lu (d:%d p:%d)",
+ "spu size: %zu, duration: %"PRIu64" (d:%zu p:%"PRIu16")",
p_sys->i_x_start, p_sys->i_y_start,
p_sys->i_width, p_sys->i_height,
- p_sys->i_spu_size, (long unsigned int) p_sys->i_duration,
+ p_sys->i_spu_size, p_sys->i_duration,
p_sys->i_image_length, p_sys->i_image_offset);
for( i = 0; i < 4; i++ )
p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL;
- p_spu->b_pausable = true;
-
- p_spu->i_x = p_sys->i_x_start;
- p_spu->i_y = p_sys->i_y_start;
p_spu->i_start = p_data->i_pts;
p_spu->i_stop = p_data->i_pts + p_sys->i_duration;
p_spu->b_ephemer = true;
p_region->fmt.i_aspect = VOUT_ASPECT_FACTOR;
p_spu->p_region = p_region;
- p_region->i_x = p_region->i_y = 0;
+ p_region->i_x = p_sys->i_x_start;
+ p_region->i_y = p_sys->i_y_start;
/* Build palette */
fmt.p_palette->i_entries = 4;
subpicture_region_t *p_region )
{
decoder_sys_t *p_sys = p_dec->p_sys;
- uint8_t *p_dest = p_region->picture.Y_PIXELS;
+ uint8_t *p_dest = p_region->p_picture->Y_PIXELS;
int i_field; /* The subtitles are interlaced */
int i_row, i_column; /* scanline row/column number */
uint8_t i_color, i_count;
if( i_color == 0 && (i_count = bs_read( &bs, 2 )) )
{
i_count = __MIN( i_count, p_sys->i_width - i_column );
- memset( &p_dest[i_row * p_region->picture.Y_PITCH +
+ memset( &p_dest[i_row * p_region->p_picture->Y_PITCH +
i_column], 0, i_count + 1 );
i_column += i_count;
continue;
}
- p_dest[i_row * p_region->picture.Y_PITCH + i_column] = i_color;
+ p_dest[i_row * p_region->p_picture->Y_PITCH + i_column] = i_color;
}
bs_align( &bs );