# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
#define ENC_POSY_TEXT N_("Encoding Y coordinate")
#define ENC_POSY_LONGTEXT N_("Y coordinate of the encoded subtitle" )
-static int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
-static const char *ppsz_pos_descriptions[] =
+static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
+static const char *const ppsz_pos_descriptions[] =
{ N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"),
N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
vlc_module_begin();
# define DVBSUB_CFG_PREFIX "dvbsub-"
- set_description( _("DVB subtitles decoder") );
+ set_description( N_("DVB subtitles decoder") );
set_capability( "decoder", 50 );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_SCODEC );
# define ENC_CFG_PREFIX "sout-dvbsub-"
add_submodule();
- set_description( _("DVB subtitles encoder") );
+ set_description( N_("DVB subtitles encoder") );
set_capability( "encoder", 100 );
set_callbacks( OpenEncoder, CloseEncoder );
add_obsolete_integer( ENC_CFG_PREFIX "timeout" ); /* Suppressed since 0.8.5 */
vlc_module_end();
-static const char *ppsz_enc_options[] = { "x", "y", NULL };
+static const char *const ppsz_enc_options[] = { "x", "y", NULL };
/****************************************************************************
* Local structures
p_dec->pf_decode_sub = Decode;
p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) );
if( !p_sys )
- {
- msg_Err( p_dec, "out of memory" );
return VLC_ENOMEM;
- }
memset( p_sys, 0, sizeof(decoder_sys_t) );
p_sys->i_pts = (mtime_t) 0;
i_posy = val.i_int;
/* Check if subpicture position was overridden */
- p_sys->b_absolute = false;
+ p_sys->b_absolute = true;
p_sys->i_spu_x = p_sys->i_spu_y = 0;
if( ( i_posx >= 0 ) && ( i_posy >= 0 ) )
#ifdef DEBUG_DVBSUB
msg_Dbg( p_dec, "new clut: %i", i_id );
#endif
- p_clut = malloc( sizeof(dvbsub_clut_t) );
+ p_clut = malloc( sizeof( dvbsub_clut_t ) );
+ if( !p_clut )
+ return;
p_clut->p_next = p_sys->p_cluts;
p_sys->p_cluts = p_clut;
}
#endif
/* Allocate a new page */
p_sys->p_page = malloc( sizeof(dvbsub_page_t) );
+ if( !p_sys->p_page )
+ return;
}
p_sys->p_page->i_version = i_version;
/* Free old object defs */
while( p_region->i_object_defs )
- {
- int i = p_region->i_object_defs - 1;
- free( p_region->p_object_defs[i].psz_text );
- if( !i )
- free( p_region->p_object_defs );
+ free( p_region->p_object_defs[--p_region->i_object_defs].psz_text );
- p_region->i_object_defs--;
- }
+ free( p_region->p_object_defs );
p_region->p_object_defs = NULL;
/* Extra sanity checks */
/* Correct positioning of SPU */
p_spu->b_absolute = p_sys->b_absolute;
- p_spu->i_flags = p_sys->i_spu_position;
p_spu->i_x = p_sys->i_spu_x;
p_spu->i_y = p_sys->i_spu_y;
p_spu->i_original_picture_width = 720;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
- {
- msg_Err( p_enc, "out of memory" );
return VLC_ENOMEM;
- }
p_enc->p_sys = p_sys;
p_enc->pf_encode_sub = Encode;