X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fsdl_image.c;h=82022e8873ebecde84bfd913f6e2901ebe3b4684;hb=166dc5d2b4e0856b8a0a8b54821561117f4fb42b;hp=6d1ccba8ff43cc959e82c47750c090ad1cfdbad7;hpb=2cb472dba008f7d877ffe6bae9c5575253365282;p=vlc diff --git a/modules/codec/sdl_image.c b/modules/codec/sdl_image.c index 6d1ccba8ff..82022e8873 100644 --- a/modules/codec/sdl_image.c +++ b/modules/codec/sdl_image.c @@ -24,8 +24,14 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include #include SDL_IMAGE_INCLUDE_FILE @@ -51,8 +57,9 @@ static picture_t *DecodeBlock ( decoder_t *, block_t ** ); vlc_module_begin(); set_category( CAT_INPUT ); set_subcategory( SUBCAT_INPUT_VCODEC ); - set_description( _("SDL_image video decoder") ); - set_capability( "decoder", 900 ); + set_shortname( N_("SDL Image decoder")); + set_description( N_("SDL_image video decoder") ); + set_capability( "decoder", 60 ); set_callbacks( OpenDecoder, CloseDecoder ); add_shortcut( "sdl_image" ); vlc_module_end(); @@ -60,7 +67,7 @@ vlc_module_end(); static const struct supported_fmt_t { vlc_fourcc_t i_fourcc; - char *psz_sdl_type; + const char *psz_sdl_type; } p_supported_fmt[] = { { VLC_FOURCC('t','g','a',' '), "TGA" }, @@ -101,10 +108,7 @@ static int OpenDecoder( vlc_object_t *p_this ) /* Allocate the memory needed to store the decoder's structure */ if( ( p_dec->p_sys = p_sys = (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) - { - msg_Err( p_dec, "out of memory" ); - return VLC_EGENERIC; - } + return VLC_ENOMEM; p_sys->psz_sdl_type = p_supported_fmt[i].psz_sdl_type; /* Set output properties - this is a decoy and isn't used anywhere */ @@ -179,7 +183,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) uint8_t r, g, b; for ( i = 0; i < p_surface->h; i++ ) { - p_src = p_surface->pixels + i * p_surface->pitch; + p_src = (uint8_t*)p_surface->pixels + i * p_surface->pitch; p_dst = p_pic->p[0].p_pixels + i * p_pic->p[0].i_pitch; for ( j = 0; j < p_surface->w; j++ ) { @@ -202,7 +206,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) for ( i = 0; i < p_surface->h; i++ ) { - p_dec->p_vlc->pf_memcpy( p_dst, p_src, i_pitch ); + vlc_memcpy( p_dst, p_src, i_pitch ); p_src += p_surface->pitch; p_dst += p_pic->p[0].i_pitch; } @@ -215,7 +219,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) uint8_t r, g, b; for ( i = 0; i < p_surface->h; i++ ) { - p_src = p_surface->pixels + i * p_surface->pitch; + p_src = (uint8_t*)p_surface->pixels + i * p_surface->pitch; p_dst = p_pic->p[0].p_pixels + i * p_pic->p[0].i_pitch; for ( j = 0; j < p_surface->w; j++ ) { @@ -236,7 +240,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) uint8_t r, g, b, a; for ( i = 0; i < p_surface->h; i++ ) { - p_src = p_surface->pixels + i * p_surface->pitch; + p_src = (uint8_t*)p_surface->pixels + i * p_surface->pitch; p_dst = p_pic->p[0].p_pixels + i * p_pic->p[0].i_pitch; for ( j = 0; j < p_surface->w; j++ ) {