]> git.sesse.net Git - vlc/blobdiff - modules/codec/dvbsub.c
macosx: Fix controller playlist toggling to use the contentRect and not the window...
[vlc] / modules / codec / dvbsub.c
index a0af36e94a864fee1ba57b0728616669cf44b20f..677c4012d00565ffb41df977f54346a4081c4aff 100644 (file)
@@ -43,7 +43,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
 #include <vlc_codec.h>
@@ -70,8 +70,8 @@
 #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") };
 
@@ -88,7 +88,7 @@ static block_t *Encode  ( encoder_t *, subpicture_t * );
 
 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 );
@@ -101,7 +101,7 @@ vlc_module_begin();
 
 #   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 );
 
@@ -110,7 +110,7 @@ vlc_module_begin();
     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
@@ -329,7 +329,7 @@ static int Open( vlc_object_t *p_this )
     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 ) )
@@ -870,14 +870,9 @@ static void decode_region_composition( decoder_t *p_dec, bs_t *s )
 
     /* 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 */
@@ -1597,7 +1592,6 @@ static subpicture_t *render( decoder_t *p_dec )
 
     /* 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;
@@ -1669,10 +1663,7 @@ static int OpenEncoder( vlc_object_t *p_this )
 
     /* 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;