/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
static void DecoderClose ( vlc_object_t * );
vlc_module_begin();
- set_description( _("CVD subtitle decoder") );
+ set_description( N_("CVD subtitle decoder") );
set_capability( "decoder", 50 );
set_callbacks( DecoderOpen, DecoderClose );
add_submodule();
- set_description( _("Chaoji VCD subtitle packetizer") );
+ set_description( N_("Chaoji VCD subtitle packetizer") );
set_capability( "packetizer", 50 );
set_callbacks( PacketizerOpen, DecoderClose );
vlc_module_end();
block_t *p_spu; /* Bytes of the packet. */
- int i_spu_size; /* goal for subtitle_data_pos while gathering,
+ size_t i_spu_size; /* goal for subtitle_data_pos while gathering,
size of used subtitle_data later */
uint16_t i_image_offset; /* offset from subtitle_data to compressed
image data */
- int i_image_length; /* size of the compressed image data */
- int first_field_offset; /* offset of even raster lines */
- int second_field_offset; /* offset of odd raster lines */
- int metadata_offset; /* offset to data describing the image */
- int metadata_length; /* length of metadata */
+ size_t i_image_length; /* size of the compressed image data */
+ size_t first_field_offset; /* offset of even raster lines */
+ size_t second_field_offset; /* offset of odd raster lines */
+ size_t metadata_offset; /* offset to data describing the image */
+ size_t metadata_length; /* length of metadata */
mtime_t i_duration; /* how long to display the image, 0 stands
for "until next subtitle" */
}
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
+ if( !p_sys )
+ return VLC_ENOMEM;
- p_sys->b_packetizer = VLC_FALSE;
+ p_sys->b_packetizer = false;
p_sys->i_state = SUBTITLE_BLOCK_EMPTY;
p_sys->p_spu = NULL;
if( DecoderOpen( p_this ) != VLC_SUCCESS ) return VLC_EGENERIC;
- p_dec->p_sys->b_packetizer = VLC_TRUE;
+ p_dec->p_sys->b_packetizer = true;
return VLC_SUCCESS;
}
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, "SPU packets size=%d should be %d",
+ msg_Warn( p_dec, "SPU packets size=%zu should be %zu",
p_spu->i_buffer, p_sys->i_spu_size );
}
- msg_Dbg( p_dec, "subtitle packet complete, size=%d", p_spu->i_buffer);
+ msg_Dbg( p_dec, "subtitle packet complete, size=%zuu", p_spu->i_buffer);
ParseMetaInfo( p_dec, p_spu );
p_sys->i_image_length = p_sys->metadata_offset - p_sys->i_image_offset;
#ifdef DEBUG_CVDSUB
- msg_Dbg( p_dec, "total size: %d image size: %d",
+ msg_Dbg( p_dec, "total size: %zu image size: %zu",
p_sys->i_spu_size, p_sys->i_image_length );
#endif
}
p_sys->first_field_offset =
(p[2] << 8) + p[3] - p_sys->i_image_offset;
#ifdef DEBUG_CVDSUB
- msg_Dbg( p_dec, "1st_field_offset %d", p_sys->first_field_offset );
+ msg_Dbg( p_dec, "1st_field_offset %zu",
+ p_sys->first_field_offset );
#endif
break;
p_sys->second_field_offset =
(p[2] << 8) + p[3] - p_sys->i_image_offset;
#ifdef DEBUG_CVDSUB
- msg_Dbg( p_dec, "2nd_field_offset %d", p_sys->second_field_offset);
+ msg_Dbg( p_dec, "2nd_field_offset %zu",
+ p_sys->second_field_offset);
#endif
break;
p_spu = p_dec->pf_spu_buffer_new( p_dec );
if( !p_spu ) return NULL;
- p_spu->b_pausable = VLC_TRUE;
+ p_spu->b_pausable = true;
p_spu->i_x = p_sys->i_x_start;
p_spu->i_x = p_spu->i_x * 3 / 4; /* FIXME: use aspect ratio for x? */
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 = VLC_TRUE;
+ p_spu->b_ephemer = true;
/* Create new SPU region */
memset( &fmt, 0, sizeof(video_format_t) );