]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/logo.c
Removed unused or redondant fields from subpicture.
[vlc] / modules / video_filter / logo.c
index f274dc2f67195a23c325834129e5d80296d259bd..4c7321da3ff065ab3fbdc81a9433e034b660e0cd 100644 (file)
@@ -101,13 +101,13 @@ static const char *const ppsz_pos_descriptions[] =
   N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
 
 vlc_module_begin();
-    set_description( N_("Logo video filter") );
-    set_capability( "video filter", 0 );
+    set_capability( "sub filter", 0 );
+    set_callbacks( CreateFilter, DestroyFilter );
+    set_description( N_("Logo sub filter") );
     set_shortname( N_("Logo overlay") );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_SUBPIC );
     add_shortcut( "logo" );
-    set_callbacks( Create, Destroy );
 
     add_file( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, false );
     add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, true );
@@ -118,13 +118,13 @@ vlc_module_begin();
     add_integer_with_range( CFG_PREFIX "transparency", 255, 0, 255, NULL,
         TRANS_TEXT, TRANS_LONGTEXT, false );
     add_integer( CFG_PREFIX "position", -1, NULL, POS_TEXT, POS_LONGTEXT, false );
-        change_integer_list( pi_pos_values, ppsz_pos_descriptions, 0 );
+        change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL );
 
-    /* subpicture filter submodule */
+    /* video output filter submodule */
     add_submodule();
-    set_capability( "sub filter", 0 );
-    set_callbacks( CreateFilter, DestroyFilter );
-    set_description( N_("Logo sub filter") );
+    set_capability( "video filter", 0 );
+    set_callbacks( Create, Destroy );
+    set_description( N_("Logo video filter") );
 vlc_module_end();
 
 static const char *const ppsz_filter_options[] = {
@@ -331,6 +331,8 @@ static int Create( vlc_object_t *p_this )
     if( !p_logo_list->psz_filename || !*p_logo_list->psz_filename )
     {
         msg_Err( p_vout, "logo file not specified" );
+        free( p_logo_list->psz_filename );
+        free( p_sys );
         return VLC_EGENERIC;
     }
 
@@ -585,7 +587,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_inpic )
     vout_DatePicture( p_sys->p_vout, p_outpic, p_inpic->date );
 
     if( p_pic )
-    p_sys->p_blend->pf_video_blend( p_sys->p_blend, p_outpic, p_outpic,
+    p_sys->p_blend->pf_video_blend( p_sys->p_blend, p_outpic,
                                     p_pic, p_sys->posx, p_sys->posy,
                                     p_logo->i_alpha != -1 ? p_logo->i_alpha
                                     : p_logo_list->i_alpha );
@@ -886,8 +888,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         p_spu->b_absolute = false;
     }
 
-    p_spu->i_x = p_sys->posx;
-    p_spu->i_y = p_sys->posy;
+    p_region->i_x = p_sys->posx;
+    p_region->i_y = p_sys->posy;
 
     p_spu->p_region = p_region;