X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fimage.c;h=afe1d618776d2903ef63127e8dbfdbb0e3a2b175;hb=85ca5599d039c3f3617b7fb1fa0c4f2f1e9a3031;hp=1b6096f9466004bc06d42cec553fb95329113901;hpb=9035e1a6f7d2f566e980dbaa6fec4b6e7f764cc8;p=vlc diff --git a/modules/video_output/image.c b/modules/video_output/image.c index 1b6096f946..afe1d61877 100644 --- a/modules/video_output/image.c +++ b/modules/video_output/image.c @@ -24,9 +24,13 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include +#include #include #include @@ -86,20 +90,20 @@ vlc_module_begin( ); set_capability( "video output", 0 ); add_string( CFG_PREFIX "format", "png", NULL, - FORMAT_TEXT, FORMAT_LONGTEXT, VLC_FALSE ); + FORMAT_TEXT, FORMAT_LONGTEXT, false ); change_string_list( psz_format_list, psz_format_list_text, 0 ); - add_integer( CFG_PREFIX "width", -1, NULL, - WIDTH_TEXT, WIDTH_LONGTEXT, VLC_TRUE ); - add_deprecated( "image-width", VLC_FALSE ); /* since 0.9.0 */ - add_integer( CFG_PREFIX "height", -1, NULL, - HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE ); - add_deprecated( "image-height", VLC_FALSE ); /* since 0.9.0 */ + add_integer( CFG_PREFIX "width", 0, NULL, + WIDTH_TEXT, WIDTH_LONGTEXT, true ); + add_deprecated_alias( "image-width" ); /* since 0.9.0 */ + add_integer( CFG_PREFIX "height", 0, NULL, + HEIGHT_TEXT, HEIGHT_LONGTEXT, true ); + add_deprecated_alias( "image-height" ); /* since 0.9.0 */ add_integer( CFG_PREFIX "ratio", 3, NULL, - RATIO_TEXT, RATIO_LONGTEXT, VLC_FALSE ); + RATIO_TEXT, RATIO_LONGTEXT, false ); add_string( CFG_PREFIX "prefix", "img", NULL, - PREFIX_TEXT, PREFIX_LONGTEXT, VLC_FALSE ); + PREFIX_TEXT, PREFIX_LONGTEXT, false ); add_bool( CFG_PREFIX "replace", 0, NULL, - REPLACE_TEXT, REPLACE_LONGTEXT, VLC_FALSE ); + REPLACE_TEXT, REPLACE_LONGTEXT, false ); set_callbacks( Create, Destroy ); vlc_module_end(); @@ -116,16 +120,16 @@ struct vout_sys_t char *psz_format; /* Format */ int i_ratio; /* Image ratio */ - int i_width; /* Image width */ - int i_height; /* Image height */ + unsigned int i_width; /* Image width */ + unsigned int i_height; /* Image height */ int i_current; /* Current image */ int i_frames; /* Number of frames */ - vlc_bool_t b_replace; + bool b_replace; - vlc_bool_t b_time; - vlc_bool_t b_meta; + bool b_time; + bool b_meta; image_handler_t *p_image; }; @@ -150,9 +154,9 @@ static int Create( vlc_object_t *p_this ) p_vout->p_sys->psz_prefix = var_CreateGetString( p_this, CFG_PREFIX "prefix" ); p_vout->p_sys->b_time = strchr( p_vout->p_sys->psz_prefix, '%' ) - ? VLC_TRUE : VLC_FALSE; + ? true : false; p_vout->p_sys->b_meta = strchr( p_vout->p_sys->psz_prefix, '$' ) - ? VLC_TRUE : VLC_FALSE; + ? true : false; p_vout->p_sys->psz_format = var_CreateGetString( p_this, CFG_PREFIX "format" ); p_vout->p_sys->i_width = @@ -274,8 +278,8 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic ) char *psz_prefix; char *psz_tmp; - memset (&fmt_in, 0, sizeof (fmt_in)); - memset (&fmt_out, 0, sizeof (fmt_out)); + memset( &fmt_in, 0, sizeof( fmt_in ) ); + memset( &fmt_out, 0, sizeof( fmt_out ) ); if( p_vout->p_sys->i_frames % p_vout->p_sys->i_ratio != 0 ) { @@ -288,9 +292,9 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic ) fmt_in.i_width = p_vout->render.i_width; fmt_in.i_height = p_vout->render.i_height; - fmt_out.i_width = p_vout->p_sys->i_width > 0 ? p_vout->p_sys->i_width : + fmt_out.i_width = (p_vout->p_sys->i_width > 0) ? p_vout->p_sys->i_width : p_vout->render.i_width; - fmt_out.i_height = p_vout->p_sys->i_height > 0 ? p_vout->p_sys->i_height : + fmt_out.i_height = (p_vout->p_sys->i_height > 0) ? p_vout->p_sys->i_height : p_vout->render.i_height; if( p_vout->p_sys->b_time ) @@ -336,4 +340,5 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic ) static void End( vout_thread_t *p_vout ) { + VLC_UNUSED(p_vout); }