X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Flogo.c;h=c6db247c9f0989b22eadaa64dd3f2f16e7f48a72;hb=79f590d49b6a4c2fb6c8325b4ec4f46078d41f7a;hp=6711479e5d8486a13e584cdb06f77a38a86af62d;hpb=13ae40b0efc4f1b1ce205d9a057537047fcab3f4;p=vlc diff --git a/modules/video_filter/logo.c b/modules/video_filter/logo.c index 6711479e5d..c6db247c9f 100644 --- a/modules/video_filter/logo.c +++ b/modules/video_filter/logo.c @@ -30,7 +30,7 @@ # include "config.h" #endif -#include +#include #include #include @@ -95,8 +95,8 @@ static int LogoCallback( vlc_object_t *, char const *, #define CFG_PREFIX "logo-" -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") }; @@ -127,7 +127,7 @@ vlc_module_begin(); set_description( N_("Logo sub filter") ); vlc_module_end(); -static const char *ppsz_filter_options[] = { +static const char *const ppsz_filter_options[] = { "file", "x", "y", "delay", "repeat", "transparency", "position", NULL }; @@ -315,14 +315,10 @@ static int Create( vlc_object_t *p_this ) /* Allocate structure */ p_sys = p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); if( p_sys == NULL ) - { - msg_Err( p_vout, "out of memory" ); return VLC_ENOMEM; - } p_logo_list = p_sys->p_logo_list = malloc( sizeof( logo_list_t ) ); if( p_logo_list == NULL ) { - msg_Err( p_vout, "out of memory" ); free( p_sys ); return VLC_ENOMEM; } @@ -489,12 +485,9 @@ static void End( vout_thread_t *p_vout ) var_DelCallback( p_sys->p_vout, "mouse-x", MouseEvent, p_vout); var_DelCallback( p_sys->p_vout, "mouse-y", MouseEvent, p_vout); - if( p_sys->p_vout ) - { - DEL_CALLBACKS( p_sys->p_vout, SendEvents ); - vlc_object_detach( p_sys->p_vout ); - vout_Destroy( p_sys->p_vout ); - } + DEL_CALLBACKS( p_sys->p_vout, SendEvents ); + vlc_object_detach( p_sys->p_vout ); + vlc_object_release( p_sys->p_vout ); if( p_sys->p_blend->p_module ) module_Unneed( p_sys->p_blend, p_sys->p_blend->p_module ); @@ -583,7 +576,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_inpic ) /* This is a new frame. Get a structure from the video_output. */ while( !(p_outpic = vout_CreatePicture( p_sys->p_vout, 0, 0, 0 )) ) { - if( p_vout->b_die || p_vout->b_error ) return; + if( !vlc_object_alive (p_vout) || p_vout->b_error ) return; msleep( VOUT_OUTMEM_SLEEP ); } @@ -711,14 +704,10 @@ static int CreateFilter( vlc_object_t *p_this ) /* Allocate structure */ p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) ); if( p_sys == NULL ) - { - msg_Err( p_filter, "out of memory" ); return VLC_ENOMEM; - } p_logo_list = p_sys->p_logo_list = malloc( sizeof( logo_list_t ) ); if( p_logo_list == NULL ) { - msg_Err( p_filter, "out of memory" ); free( p_sys ); return VLC_ENOMEM; }