1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-24 20:48:52 +02:00

codecs & packetizers: fix warnings

use size_t instead of int to represent sizes
    removes unused parameters from:
        block_BytestreamInit()
        mpeg4_audio/LOASSyncInfo()
        cinepak/cinepak_Getv1()
        speex/SendPacket()
        subsass/ParseColor()
        ffmpeg/postprocess/InitPostproc() & PostprocPict()
        dvbsub/YuvaYuvp() & encode_pixel_line_{2,4,8}bp()
        faad/DoReordering()

vlc_block_helper.h:
    use size_t, removes unused parameter from block_BytestreamInit()

struct filter_t:
    removes unused parameters from pf_picture_link() & pf_picture_unlink()
    
cmml: fix a segfault (p_item isn't an input item, despite the name) present for some months, proving that nobody did use that code ?
This commit is contained in:
Rafaël Carré 2008-01-29 13:34:30 +00:00
parent c480245472
commit 079a1818dc
41 changed files with 156 additions and 140 deletions

View File

@ -34,16 +34,14 @@ typedef struct block_bytestream_t
{
block_t *p_chain;
block_t *p_block;
int i_offset;
size_t i_offset;
} block_bytestream_t;
#define block_BytestreamInit( a ) __block_BytestreamInit( VLC_OBJECT(a) )
/*****************************************************************************
* block_bytestream_t management
*****************************************************************************/
static inline block_bytestream_t __block_BytestreamInit( vlc_object_t *p_obj )
static inline block_bytestream_t block_BytestreamInit( void )
{
block_bytestream_t bytestream;
@ -216,10 +214,10 @@ static inline int block_GetByte( block_bytestream_t *p_bytestream,
}
static inline int block_WaitBytes( block_bytestream_t *p_bytestream,
int i_data )
size_t i_data )
{
block_t *p_block;
int i_offset, i_copy, i_size;
size_t i_offset, i_copy, i_size;
/* Check we have that much data */
i_offset = p_bytestream->i_offset;
@ -244,10 +242,10 @@ static inline int block_WaitBytes( block_bytestream_t *p_bytestream,
}
static inline int block_SkipBytes( block_bytestream_t *p_bytestream,
int i_data )
size_t i_data )
{
block_t *p_block;
int i_offset, i_copy;
size_t i_offset, i_copy;
/* Check we have that much data */
i_offset = p_bytestream->i_offset;
@ -275,10 +273,10 @@ static inline int block_SkipBytes( block_bytestream_t *p_bytestream,
}
static inline int block_PeekBytes( block_bytestream_t *p_bytestream,
uint8_t *p_data, int i_data )
uint8_t *p_data, size_t i_data )
{
block_t *p_block;
int i_offset, i_copy, i_size;
size_t i_offset, i_copy, i_size;
/* Check we have that much data */
i_offset = p_bytestream->i_offset;
@ -325,10 +323,10 @@ static inline int block_PeekBytes( block_bytestream_t *p_bytestream,
}
static inline int block_GetBytes( block_bytestream_t *p_bytestream,
uint8_t *p_data, int i_data )
uint8_t *p_data, size_t i_data )
{
block_t *p_block;
int i_offset, i_copy, i_size;
size_t i_offset, i_copy, i_size;
/* Check we have that much data */
i_offset = p_bytestream->i_offset;
@ -379,10 +377,10 @@ static inline int block_GetBytes( block_bytestream_t *p_bytestream,
}
static inline int block_PeekOffsetBytes( block_bytestream_t *p_bytestream,
int i_peek_offset, uint8_t *p_data, int i_data )
size_t i_peek_offset, uint8_t *p_data, size_t i_data )
{
block_t *p_block;
int i_offset, i_copy, i_size;
size_t i_offset, i_copy, i_size;
/* Check we have that much data */
i_offset = p_bytestream->i_offset;
@ -443,11 +441,12 @@ static inline int block_PeekOffsetBytes( block_bytestream_t *p_bytestream,
}
static inline int block_FindStartcodeFromOffset(
block_bytestream_t *p_bytestream, int *pi_offset,
block_bytestream_t *p_bytestream, size_t *pi_offset,
uint8_t *p_startcode, int i_startcode_length )
{
block_t *p_block, *p_block_backup = 0;
int i_size, i_offset, i_offset_backup = 0;
int i_size = 0;
size_t i_offset, i_offset_backup = 0;
int i_caller_offset_backup = 0, i_match;
/* Find the right place */
@ -468,7 +467,7 @@ static inline int block_FindStartcodeFromOffset(
/* Begin the search.
* We first look for an occurrence of the 1st startcode byte and
* if found, we do a more thorough check. */
i_size = p_block->i_buffer + i_size;
i_size += p_block->i_buffer;
*pi_offset -= i_size;
i_match = 0;
for( ; p_block != NULL; p_block = p_block->p_next )

View File

@ -81,8 +81,8 @@ struct filter_t
/* Video output callbacks */
picture_t * ( * pf_vout_buffer_new) ( filter_t * );
void ( * pf_vout_buffer_del) ( filter_t *, picture_t * );
void ( * pf_picture_link) ( filter_t *, picture_t * );
void ( * pf_picture_unlink) ( filter_t *, picture_t * );
void ( * pf_picture_link) ( picture_t * );
void ( * pf_picture_unlink) ( picture_t * );
/* SPU output callbacks */
subpicture_t * ( * pf_sub_buffer_new) ( filter_t * );

View File

@ -133,7 +133,7 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->i_state = STATE_NOSYNC;
aout_DateSet( &p_sys->end_date, 0 );
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
p_sys->i_input_rate = INPUT_RATE_DEFAULT;
/* Set output properties */

View File

@ -68,8 +68,8 @@ struct decoder_sys_t
{
enum adpcm_codec_e codec;
int i_block;
int i_samplesperblock;
size_t i_block;
size_t i_samplesperblock;
audio_date_t end_date;
};
@ -618,7 +618,7 @@ static void DecodeAdpcmDk4( decoder_t *p_dec, int16_t *p_sample,
{
decoder_sys_t *p_sys = p_dec->p_sys;
adpcm_ima_wav_channel_t channel[2];
int i_nibbles;
size_t i_nibbles;
int b_stereo;
b_stereo = p_dec->fmt_in.audio.i_channels == 2 ? 1 : 0;

View File

@ -1463,7 +1463,7 @@ static int EncoderOpen( vlc_object_t *p_this )
*****************************************************************************/
static void EncoderClose ( vlc_object_t *p_this )
{
return;
VLC_UNUSED(p_this);
}
/*****************************************************************************

View File

@ -226,8 +226,6 @@ static subpicture_t *Convert( decoder_t *, block_t * );
static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
if( pp_block && *pp_block )
{
Push( p_dec, *pp_block );

View File

@ -66,6 +66,7 @@ static inline void cc_Init( cc_data_t *c )
}
static inline void cc_Exit( cc_data_t *c )
{
VLC_UNUSED(c);
return;
}
static inline void cc_Flush( cc_data_t *c )

View File

@ -2,7 +2,7 @@
* cdg.c: CDG decoder module
*****************************************************************************
* Copyright (C) 2007 Laurent Aimar
* $Id: $
* $Id$
*
* Authors: Laurent Aimar <fenrir # via.ecp.fr>
*
@ -194,8 +194,9 @@ static void ScreenFill( decoder_sys_t *p_cdg, int sx, int sy, int dx, int dy, in
static int DecodeMemoryPreset( decoder_sys_t *p_cdg, const uint8_t *p_data )
{
const int i_color = p_data[0]&0x0f;
#if 0
const int i_repeat= p_data[1]&0x0f;
#endif
/* if i_repeat > 0 we could ignore it if we have a reliable stream */
ScreenFill( p_cdg, 0, 0, CDG_SCREEN_WIDTH, CDG_SCREEN_HEIGHT, i_color );
return 0;

View File

@ -278,7 +278,7 @@ static void cinepak_LoadCodebook( cinepak_codebook_t *p_codebook,
static void cinepak_Getv4( cinepak_context_t *p_context,
int i_strip, int i_x, int i_y,
int i_x2, int i_y2, uint8_t *p_data )
uint8_t *p_data )
{
uint8_t i_index[4];
int i,j;
@ -325,7 +325,7 @@ static void cinepak_Getv4( cinepak_context_t *p_context,
static void cinepak_Getv1( cinepak_context_t *p_context,
int i_strip, int i_x, int i_y,
int i_x2, int i_y2, uint8_t *p_data )
uint8_t *p_data )
{
uint8_t i_index;
int i,j;
@ -587,7 +587,6 @@ static int cinepak_decode_frame( cinepak_context_t *p_context,
i_strip,
i_strip_x1 + i_x,
i_strip_y1 + i_y,
i_strip_x2, i_strip_y2,
p_data );
p_data += 4;
i_chunk_size -= 4;
@ -598,7 +597,6 @@ static int cinepak_decode_frame( cinepak_context_t *p_context,
i_strip,
i_strip_x1 + i_x,
i_strip_y1 + i_y,
i_strip_x2, i_strip_y2,
p_data );
p_data++;
i_chunk_size--;
@ -646,7 +644,6 @@ static int cinepak_decode_frame( cinepak_context_t *p_context,
i_strip,
i_strip_x1 + i_x,
i_strip_y1 + i_y,
i_strip_x2, i_strip_y2,
p_data );
p_data += 4;
i_chunk_size -= 4;
@ -658,7 +655,6 @@ static int cinepak_decode_frame( cinepak_context_t *p_context,
i_strip,
i_strip_x1 + i_x,
i_strip_y1 + i_y,
i_strip_x2, i_strip_y2,
p_data );
p_data++;
i_chunk_size--;
@ -684,7 +680,6 @@ static int cinepak_decode_frame( cinepak_context_t *p_context,
i_strip,
i_strip_x1 + i_x,
i_strip_y1 + i_y,
i_strip_x2, i_strip_y2,
p_data );
p_data++;
i_chunk_size--;

View File

@ -119,10 +119,8 @@ static void history_Dump( history_t *p_history )
fprintf( stderr, "HISTORY: [%d] NULL\n", i );
else
{
char *psz_uri = input_item_GetURI( p_item );
fprintf( stderr, "HISTORY: [%d] %p (%p->%s)\n", i, p_item,
psz_uri, psz_uri );
free( psz_uri );
p_item->psz_uri, p_item->psz_uri );
}
}
}

View File

@ -78,6 +78,10 @@ struct navigation_history_t
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
int E_(OpenIntf) ( vlc_object_t * );
void E_(CloseIntf) ( vlc_object_t * );
static int InitThread ( intf_thread_t * );
static int MouseEvent ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
@ -400,6 +404,9 @@ static int InitThread( intf_thread_t * p_intf )
static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(psz_var);
VLC_UNUSED(oldval); VLC_UNUSED(newval);
VLC_UNUSED(p_data);
/* TODO: handle mouse clicks on the anchor text */
return VLC_SUCCESS;
@ -411,6 +418,8 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(psz_var);
VLC_UNUSED(oldval); VLC_UNUSED(newval);
intf_thread_t *p_intf = (intf_thread_t *)p_data;
vlc_mutex_lock( &p_intf->change_lock );
@ -576,6 +585,7 @@ char *GetTimedURLFromPlaylistItem( intf_thread_t *p_intf,
return psz_return_value;
#else
VLC_UNUSED(p_intf);
void *p;
/* Suppress warning messages about unused functions */
@ -616,6 +626,8 @@ static
int GoBackCallback( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(psz_var);
VLC_UNUSED(oldval); VLC_UNUSED(newval);
intf_thread_t *p_intf = (intf_thread_t *) p_data;
GoBack( p_intf );
return VLC_SUCCESS;
@ -625,6 +637,8 @@ static
int GoForwardCallback( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(psz_var);
VLC_UNUSED(oldval); VLC_UNUSED(newval);
intf_thread_t *p_intf = (intf_thread_t *) p_data;
GoForward( p_intf );
return VLC_SUCCESS;
@ -635,6 +649,8 @@ int FollowAnchorCallback( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval,
void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(psz_var);
VLC_UNUSED(oldval); VLC_UNUSED(newval);
intf_thread_t *p_intf = (intf_thread_t *) p_data;
FollowAnchor( p_intf );
return VLC_SUCCESS;

View File

@ -32,6 +32,10 @@
#include <string.h>
#include "xarray.h"
/* local prototypes */
XSTATIC XArray * xarray_New (unsigned int);
#define XARRAY_ASSERT_NOT_NULL(xarray) \
{ \
if (xarray == NULL) return XARRAY_ENULLPOINTER; \
@ -39,9 +43,7 @@
#define XARRAY_BOUNDS_CHECK(xarray, index) \
{ \
if (index < 0) \
return XARRAY_ENEGATIVEINDEX; \
else if (xarray->last_valid_element != -1 && \
if (xarray->last_valid_element != -1 && \
(int) index > xarray->last_valid_element) \
return XARRAY_EINDEXTOOLARGE; \
}
@ -61,7 +63,7 @@ XSTATIC XArray * xarray_New (unsigned int initial_size_hint)
new_xarray = (XArray *) malloc (sizeof(XArray));
if (new_xarray == NULL) return NULL;
if (initial_size_hint <= 0)
if (initial_size_hint == 0)
initial_size = XARRAY_DEFAULT_SIZE;
else
initial_size = initial_size_hint;

View File

@ -81,6 +81,15 @@ struct _XTagParser {
char * end;
};
XTag * xtag_free (XTag * xtag);
XTag * xtag_new_parse (const char * s, int n);
char * xtag_get_name (XTag * xtag);
char * xtag_get_pcdata (XTag * xtag);
char * xtag_get_attribute (XTag * xtag, char * attribute);
XTag * xtag_first_child (XTag * xtag, char * name);
XTag * xtag_next_child (XTag * xtag, char * name);
int xtag_snprint (char * buf, int n, XTag * xtag);
/* Character classes */
#define X_NONE 0
#define X_WHITESPACE 1<<0

View File

@ -39,6 +39,7 @@ static char *xurl_strdup( const char *psz_string );
#define xurl_strdup strdup
#endif
char *XURL_FindQuery ( char *psz_url );
static char *XURL_FindHostname ( char *psz_url );
static char *XURL_FindPath ( char *psz_url );
static char *XURL_FindFragment ( char *psz_url );
@ -258,7 +259,6 @@ char *XURL_FindFragment( char *psz_url )
return pc_return_value;
}
char *XURL_FindQuery( char *psz_url )
{
char *pc_question_mark = NULL;

View File

@ -80,16 +80,16 @@ struct decoder_sys_t
block_t *p_spu; /* Bytes of the packet. */
int i_spu_size; /* goal for subtitle_data_pos while gathering,
size_t i_spu_size; /* goal for subtitle_data_pos while gathering,
size of used subtitle_data later */
uint16_t i_image_offset; /* offset from subtitle_data to compressed
image data */
int i_image_length; /* size of the compressed image data */
int first_field_offset; /* offset of even raster lines */
int second_field_offset; /* offset of odd raster lines */
int metadata_offset; /* offset to data describing the image */
int metadata_length; /* length of metadata */
size_t i_image_length; /* size of the compressed image data */
size_t first_field_offset; /* offset of even raster lines */
size_t second_field_offset; /* offset of odd raster lines */
size_t metadata_offset; /* offset to data describing the image */
size_t metadata_length; /* length of metadata */
mtime_t i_duration; /* how long to display the image, 0 stands
for "until next subtitle" */

View File

@ -108,7 +108,7 @@ static long STDCALL GetBufferAndLength( IMediaBuffer *This,
CMediaBuffer *p_mb = (CMediaBuffer *)This;
if( !ppBuffer && !pcbLength ) return E_POINTER;
if( ppBuffer ) *ppBuffer = p_mb->p_block->p_buffer;
if( ppBuffer ) *ppBuffer = (char*)p_mb->p_block->p_buffer;
if( pcbLength ) *pcbLength = p_mb->p_block->i_buffer;
return S_OK;
}

View File

@ -54,7 +54,7 @@
#ifdef LOADER
/* Not Needed */
long CoInitialize( void *pvReserved ) { return -1; }
long CoInitialize( void *pvReserved ) { VLC_UNUSED(pvReserved); return -1; }
void CoUninitialize( void ) { }
/* A few prototypes */

View File

@ -133,7 +133,7 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->i_state = STATE_NOSYNC;
aout_DateSet( &p_sys->end_date, 0 );
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;

View File

@ -1700,7 +1700,7 @@ static int OpenEncoder( vlc_object_t *p_this )
/* FIXME: this routine is a hack to convert VLC_FOURCC('Y','U','V','A')
* into VLC_FOURCC('Y','U','V','P')
*/
static subpicture_t *YuvaYuvp( encoder_t *p_enc, subpicture_t *p_subpic )
static subpicture_t *YuvaYuvp( subpicture_t *p_subpic )
{
subpicture_region_t *p_region = NULL;
@ -1920,7 +1920,7 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic )
p_region = p_subpic->p_region;
if( p_region->fmt.i_chroma == VLC_FOURCC('Y','U','V','A') )
{
p_temp = YuvaYuvp( p_enc, p_subpic );
p_temp = YuvaYuvp( p_subpic );
if( !p_temp )
{
msg_Err( p_enc, "no picture in subpicture" );
@ -2318,14 +2318,11 @@ static void encode_object( encoder_t *p_enc, bs_t *s, subpicture_t *p_subpic )
}
}
static void encode_pixel_line_2bp( encoder_t *p_enc, bs_t *s,
subpicture_region_t *p_region,
static void encode_pixel_line_2bp( bs_t *s, subpicture_region_t *p_region,
int i_line );
static void encode_pixel_line_4bp( encoder_t *p_enc, bs_t *s,
subpicture_region_t *p_region,
static void encode_pixel_line_4bp( bs_t *s, subpicture_region_t *p_region,
int i_line );
static void encode_pixel_line_8bp( encoder_t *p_enc, bs_t *s,
subpicture_region_t *p_region,
static void encode_pixel_line_8bp( bs_t *s, subpicture_region_t *p_region,
int i_line );
static void encode_pixel_data( encoder_t *p_enc, bs_t *s,
subpicture_region_t *p_region,
@ -2347,17 +2344,17 @@ static void encode_pixel_data( encoder_t *p_enc, bs_t *s,
case 4:
bs_write( s, 8, 0x10 ); /* 2 bit/pixel code string */
encode_pixel_line_2bp( p_enc, s, p_region, i_line );
encode_pixel_line_2bp( s, p_region, i_line );
break;
case 16:
bs_write( s, 8, 0x11 ); /* 4 bit/pixel code string */
encode_pixel_line_4bp( p_enc, s, p_region, i_line );
encode_pixel_line_4bp( s, p_region, i_line );
break;
case 256:
bs_write( s, 8, 0x12 ); /* 8 bit/pixel code string */
encode_pixel_line_8bp( p_enc, s, p_region, i_line );
encode_pixel_line_8bp( s, p_region, i_line );
break;
default:
@ -2370,8 +2367,7 @@ static void encode_pixel_data( encoder_t *p_enc, bs_t *s,
}
}
static void encode_pixel_line_2bp( encoder_t *p_enc, bs_t *s,
subpicture_region_t *p_region,
static void encode_pixel_line_2bp( bs_t *s, subpicture_region_t *p_region,
int i_line )
{
unsigned int i, i_length = 0;
@ -2462,8 +2458,7 @@ static void encode_pixel_line_2bp( encoder_t *p_enc, bs_t *s,
bs_align_0( s );
}
static void encode_pixel_line_4bp( encoder_t *p_enc, bs_t *s,
subpicture_region_t *p_region,
static void encode_pixel_line_4bp( bs_t *s, subpicture_region_t *p_region,
int i_line )
{
unsigned int i, i_length = 0;
@ -2561,8 +2556,7 @@ static void encode_pixel_line_4bp( encoder_t *p_enc, bs_t *s,
bs_align_0( s );
}
static void encode_pixel_line_8bp( encoder_t *p_enc, bs_t *s,
subpicture_region_t *p_region,
static void encode_pixel_line_8bp( bs_t *s, subpicture_region_t *p_region,
int i_line )
{
unsigned int i, i_length = 0;

View File

@ -51,8 +51,7 @@ vlc_module_end();
* Local prototypes
****************************************************************************/
static aout_buffer_t *DecodeBlock( decoder_t *, block_t ** );
static void DoReordering( decoder_t *, uint32_t *, uint32_t *, int, int,
uint32_t * );
static void DoReordering( uint32_t *, uint32_t *, int, int, uint32_t * );
#define MAX_CHANNEL_POSITIONS 9
@ -67,7 +66,7 @@ struct decoder_sys_t
/* temporary buffer */
uint8_t *p_buffer;
int i_buffer;
int i_buffer_size;
size_t i_buffer_size;
/* Channel positions of the current stream (for re-ordering) */
uint32_t pi_channel_positions[MAX_CHANNEL_POSITIONS];
@ -406,7 +405,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_out->end_date = aout_DateIncrement( &p_sys->date,
(frame.samples / frame.channels) * p_sys->i_input_rate / INPUT_RATE_DEFAULT );
DoReordering( p_dec, (uint32_t *)p_out->p_buffer, samples,
DoReordering( (uint32_t *)p_out->p_buffer, samples,
frame.samples / frame.channels, frame.channels,
p_sys->pi_channel_positions );
@ -441,8 +440,7 @@ static void Close( vlc_object_t *p_this )
* DoReordering: do some channel re-ordering (the ac3 channel order is
* different from the aac one).
*****************************************************************************/
static void DoReordering( decoder_t *p_dec,
uint32_t *p_out, uint32_t *p_in, int i_samples,
static void DoReordering( uint32_t *p_out, uint32_t *p_in, int i_samples,
int i_nb_channels, uint32_t *pi_chan_positions )
{
int pi_chan_table[MAX_CHANNEL_POSITIONS];

View File

@ -388,6 +388,7 @@ static int FakeCallback( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval,
void *p_data )
{
VLC_UNUSED(p_this); VLC_UNUSED(oldval);
decoder_t *p_dec = (decoder_t *)p_data;
if( !strcmp( psz_var, "fake-file" ) )

View File

@ -283,7 +283,7 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block )
block_Release( p_block );
return NULL;
}
else if( i_used > p_block->i_buffer )
else if( (size_t)i_used > p_block->i_buffer )
{
i_used = p_block->i_buffer;
}

View File

@ -247,9 +247,12 @@ static picture_t *video_new_buffer_filter( filter_t *p_filter )
static void video_del_buffer_filter( filter_t *p_filter, picture_t *p_pic )
{
(void)p_filter;
if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig );
if( p_pic ) free( p_pic );
VLC_UNUSED(p_filter);
if( p_pic )
{
free( p_pic->p_data_orig );
free( p_pic );
}
}
/*****************************************************************************

View File

@ -163,7 +163,7 @@ static const uint16_t mpa_bitrate_tab[2][15] =
static const uint16_t mpa_freq_tab[6] =
{ 44100, 48000, 32000, 22050, 24000, 16000 };
static const int16_t mpeg4_default_intra_matrix[64] = {
static const uint16_t mpeg4_default_intra_matrix[64] = {
8, 17, 18, 19, 21, 23, 25, 27,
17, 18, 19, 21, 23, 25, 27, 28,
20, 21, 22, 23, 24, 26, 28, 30,
@ -174,7 +174,7 @@ static const int16_t mpeg4_default_intra_matrix[64] = {
27, 28, 30, 32, 35, 38, 41, 45,
};
static const int16_t mpeg4_default_non_intra_matrix[64] = {
static const uint16_t mpeg4_default_non_intra_matrix[64] = {
16, 17, 18, 19, 20, 21, 22, 23,
17, 18, 19, 20, 21, 22, 23, 24,
18, 19, 20, 21, 22, 23, 24, 25,

View File

@ -79,8 +79,8 @@ void E_(CloseScaler)( vlc_object_t * );
/* Postprocessing module */
void *E_(OpenPostproc)( decoder_t *, vlc_bool_t * );
int E_(InitPostproc)( decoder_t *, void *, int, int, int );
int E_(PostprocPict)( decoder_t *, void *, picture_t *, struct AVFrame * );
int E_(InitPostproc)( void *, int, int, int );
int E_(PostprocPict)( void *, picture_t *, struct AVFrame * );
void E_(ClosePostproc)( decoder_t *, void * );
/*****************************************************************************

View File

@ -122,8 +122,7 @@ void *E_(OpenPostproc)( decoder_t *p_dec, vlc_bool_t *pb_pp )
/*****************************************************************************
* InitPostproc:
*****************************************************************************/
int E_(InitPostproc)( decoder_t *p_dec, void *p_data,
int i_width, int i_height, int pix_fmt )
int E_(InitPostproc)( void *p_data, int i_width, int i_height, int pix_fmt )
{
video_postproc_sys_t *p_sys = (video_postproc_sys_t *)p_data;
unsigned i_cpu = vlc_CPU();
@ -173,8 +172,7 @@ int E_(InitPostproc)( decoder_t *p_dec, void *p_data,
/*****************************************************************************
* PostprocPict:
*****************************************************************************/
int E_(PostprocPict)( decoder_t *p_dec, void *p_data,
picture_t *p_pic, AVFrame *p_ff_pic )
int E_(PostprocPict)( void *p_data, picture_t *p_pic, AVFrame *p_ff_pic )
{
video_postproc_sys_t *p_sys = (video_postproc_sys_t *)p_data;
@ -224,6 +222,7 @@ void E_(ClosePostproc)( decoder_t *p_dec, void *p_data )
static int PPQCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
decoder_t *p_dec = (decoder_t *)p_this;
video_postproc_sys_t *p_sys = (video_postproc_sys_t *)p_data;

View File

@ -205,7 +205,7 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
if( p_sys->p_pp && p_sys->b_pp && !p_sys->b_pp_init )
{
E_(InitPostproc)( p_dec, p_sys->p_pp, p_context->width,
E_(InitPostproc)( p_sys->p_pp, p_context->width,
p_context->height, p_context->pix_fmt );
p_sys->b_pp_init = VLC_TRUE;
}
@ -805,7 +805,7 @@ static void ffmpeg_CopyPicture( decoder_t *p_dec,
int i_src_stride, i_dst_stride;
if( p_sys->p_pp && p_sys->b_pp )
E_(PostprocPict)( p_dec, p_sys->p_pp, p_pic, p_ff_pic );
E_(PostprocPict)( p_sys->p_pp, p_pic, p_ff_pic );
else
{
for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )

View File

@ -223,7 +223,7 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->i_state = STATE_NOSYNC;
p_sys->b_stream_info = VLC_FALSE;
p_sys->p_block=NULL;
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
#ifdef USE_LIBFLAC
/* Take care of flac init */
@ -586,6 +586,7 @@ static FLAC__StreamDecoderReadStatus
DecoderReadCallback( const FLAC__StreamDecoder *decoder, FLAC__byte buffer[],
unsigned *bytes, void *client_data )
{
VLC_UNUSED(decoder);
decoder_t *p_dec = (decoder_t *)client_data;
decoder_sys_t *p_sys = p_dec->p_sys;
@ -613,6 +614,7 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
const FLAC__Frame *frame,
const FLAC__int32 *const buffer[], void *client_data )
{
VLC_UNUSED(decoder);
decoder_t *p_dec = (decoder_t *)client_data;
decoder_sys_t *p_sys = p_dec->p_sys;
@ -648,6 +650,7 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder,
const FLAC__StreamMetadata *metadata,
void *client_data )
{
VLC_UNUSED(decoder);
decoder_t *p_dec = (decoder_t *)client_data;
decoder_sys_t *p_sys = p_dec->p_sys;
@ -697,6 +700,7 @@ static void DecoderErrorCallback( const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status,
void *client_data )
{
VLC_UNUSED(decoder);
decoder_t *p_dec = (decoder_t *)client_data;
switch( status )
@ -1344,6 +1348,7 @@ static void EncoderMetadataCallback( const FLAC__StreamEncoder *encoder,
const FLAC__StreamMetadata *metadata,
void *client_data )
{
VLC_UNUSED(encoder);
encoder_t *p_enc = (encoder_t *)client_data;
msg_Err( p_enc, "MetadataCallback: %i", metadata->type );
@ -1359,6 +1364,7 @@ EncoderWriteCallback( const FLAC__StreamEncoder *encoder,
unsigned bytes, unsigned samples,
unsigned current_frame, void *client_data )
{
VLC_UNUSED(encoder); VLC_UNUSED(current_frame);
encoder_t *p_enc = (encoder_t *)client_data;
encoder_sys_t *p_sys = p_enc->p_sys;
block_t *p_block;

View File

@ -160,7 +160,7 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys->b_packetizer = VLC_FALSE;
p_sys->i_state = STATE_NOSYNC;
aout_DateSet( &p_sys->end_date, 0 );
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
p_sys->b_discontinuity = VLC_FALSE;
p_sys->i_input_rate = INPUT_RATE_DEFAULT;

View File

@ -96,7 +96,7 @@ static int OpenDecoder( vlc_object_t *p_this )
static void user_read( png_structp p_png, png_bytep data, png_size_t i_length )
{
block_t *p_block = (block_t *)png_get_io_ptr( p_png );
png_size_t i_read = __MIN( p_block->i_buffer, (int)i_length );
png_size_t i_read = __MIN( p_block->i_buffer, i_length );
memcpy( data, p_block->p_buffer, i_length );
p_block->p_buffer += i_length;
p_block->i_buffer -= i_length;

View File

@ -43,7 +43,7 @@ struct decoder_sys_t
/*
* Input properties
*/
int i_raw_size;
size_t i_raw_size;
vlc_bool_t b_invert;
/*

View File

@ -185,7 +185,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++ )
{
@ -221,7 +221,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++ )
{
@ -242,7 +242,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++ )
{

View File

@ -96,7 +96,7 @@ static int ProcessInitialHeader ( decoder_t *, ogg_packet * );
static void *ProcessPacket( decoder_t *, ogg_packet *, block_t ** );
static aout_buffer_t *DecodePacket( decoder_t *, ogg_packet * );
static block_t *SendPacket( decoder_t *, ogg_packet *, block_t * );
static block_t *SendPacket( decoder_t *, block_t * );
static void ParseSpeexComments( decoder_t *, ogg_packet * );
@ -486,8 +486,8 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
*/
speex_bits_rewind( &p_sys->bits );
speex_bits_write( &p_sys->bits,
p_new_block->p_buffer,
i_bytes_in_speex_frame );
(char*)p_new_block->p_buffer,
(int)i_bytes_in_speex_frame );
/*
* Move the remaining part of the original packet (subsequent
@ -506,11 +506,11 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
*/
i_bytes_in_speex_frame--;
speex_bits_write( &p_sys->bits,
p_block->p_buffer,
p_block->i_buffer - i_bytes_in_speex_frame );
p_block = block_Realloc( p_block,
(char*)p_block->p_buffer,
p_block->i_buffer - i_bytes_in_speex_frame );
p_block = block_Realloc( p_block,
0,
p_block->i_buffer-i_bytes_in_speex_frame );
p_block->i_buffer-i_bytes_in_speex_frame );
*pp_block = p_block;
}
else
@ -519,11 +519,11 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
}
free( p_frame_holder );
return SendPacket( p_dec, p_oggpacket /*Not used*/, p_new_block);
return SendPacket( p_dec, p_new_block);
}
else
{
return SendPacket( p_dec, p_oggpacket, p_block );
return SendPacket( p_dec, p_block );
}
}
else
@ -636,8 +636,8 @@ static aout_buffer_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block
Decode the input and ensure that no errors
were encountered.
*/
i_decode_ret =
speex_decode_int( p_sys->p_state,&p_sys->bits,p_aout_buffer->p_buffer );
i_decode_ret = speex_decode_int( p_sys->p_state, &p_sys->bits,
(spx_int16_t*)p_aout_buffer->p_buffer );
if ( i_decode_ret < 0 )
{
msg_Err( p_dec, "Decoding failed. Perhaps we have a bad stream?" );
@ -724,8 +724,7 @@ static aout_buffer_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
/*****************************************************************************
* SendPacket: send an ogg packet to the stream output.
*****************************************************************************/
static block_t *SendPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
block_t *p_block )
static block_t *SendPacket( decoder_t *p_dec, block_t *p_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;

View File

@ -151,10 +151,7 @@ void ParseSSAString( decoder_t *p_dec,
* ParseColor: SSA stores color in BBGGRR, in ASS it uses AABBGGRR
* The string value in the string can be a pure integer, or hexadecimal &HBBGGRR
*****************************************************************************/
static void ParseColor( decoder_t *p_dec,
char *psz_color,
int *pi_color,
int *pi_alpha )
static void ParseColor( char *psz_color, int *pi_color, int *pi_alpha )
{
int i_color = 0;
if( !strncasecmp( psz_color, "&H", 2 ) )
@ -243,8 +240,8 @@ void ParseSSAHeader( decoder_t *p_dec )
p_style->font_style.psz_fontname = strdup( psz_temp_fontname );
p_style->font_style.i_font_size = i_font_size;
ParseColor( p_dec, psz_temp_color1, &p_style->font_style.i_font_color, NULL );
ParseColor( p_dec, psz_temp_color4, &p_style->font_style.i_shadow_color, NULL );
ParseColor( psz_temp_color1, &p_style->font_style.i_font_color, NULL );
ParseColor( psz_temp_color4, &p_style->font_style.i_shadow_color, NULL );
p_style->font_style.i_outline_color = p_style->font_style.i_shadow_color;
p_style->font_style.i_font_alpha = p_style->font_style.i_outline_alpha
= p_style->font_style.i_shadow_alpha = 0x00;
@ -304,11 +301,11 @@ void ParseSSAHeader( decoder_t *p_dec )
p_style->font_style.psz_fontname = strdup( psz_temp_fontname );
p_style->font_style.i_font_size = i_font_size;
msg_Dbg( p_dec, psz_temp_color1 );
ParseColor( p_dec, psz_temp_color1, &p_style->font_style.i_font_color,
ParseColor( psz_temp_color1, &p_style->font_style.i_font_color,
&p_style->font_style.i_font_alpha );
ParseColor( p_dec, psz_temp_color3, &p_style->font_style.i_outline_color,
ParseColor( psz_temp_color3, &p_style->font_style.i_outline_color,
&p_style->font_style.i_outline_alpha );
ParseColor( p_dec, psz_temp_color4, &p_style->font_style.i_shadow_color,
ParseColor( psz_temp_color4, &p_style->font_style.i_shadow_color,
&p_style->font_style.i_shadow_alpha );
p_style->font_style.i_style_flags = 0;

View File

@ -113,15 +113,15 @@ struct decoder_sys_t
uint16_t i_image; /* image number in the subtitle stream */
uint8_t i_packet; /* packet number for above image number */
int i_spu_size; /* goal for subtitle_data_pos while gathering,
size_t i_spu_size; /* goal for subtitle_data_pos while gathering,
size of used subtitle_data later */
uint16_t i_image_offset; /* offset from subtitle_data to compressed
image data */
int i_image_length; /* size of the compressed image data */
int second_field_offset; /* offset of odd raster lines */
int metadata_offset; /* offset to data describing the image */
int metadata_length; /* length of metadata */
size_t i_image_length; /* size of the compressed image data */
size_t second_field_offset; /* offset of odd raster lines */
size_t metadata_offset; /* offset to data describing the image */
size_t metadata_length; /* length of metadata */
mtime_t i_duration; /* how long to display the image, 0 stands
for "until next subtitle" */

View File

@ -1181,8 +1181,8 @@ static int Open ( vlc_object_t *p_this )
p_enc->fmt_out.p_extra = realloc( p_enc->fmt_out.p_extra, p_enc->fmt_out.i_extra + i_size );
memcpy( p_enc->fmt_out.p_extra + p_enc->fmt_out.i_extra,
p_sys->p_buffer, i_size );
memcpy( (uint8_t*)p_enc->fmt_out.p_extra + p_enc->fmt_out.i_extra,
p_sys->p_buffer, i_size );
p_enc->fmt_out.i_extra += i_size;
}

View File

@ -87,7 +87,7 @@ struct decoder_sys_t
block_bytestream_t bytestream;
int i_state;
int i_offset;
size_t i_offset;
uint8_t startcode[4];
vlc_bool_t b_slice;
@ -182,7 +182,7 @@ static int Open( vlc_object_t *p_this )
p_sys->startcode[1] = 0;
p_sys->startcode[2] = 0;
p_sys->startcode[3] = 1;
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
p_sys->b_slice = VLC_FALSE;
p_sys->p_frame = NULL;
p_sys->b_sps = VLC_FALSE;

View File

@ -209,7 +209,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
/* Misc init */
p_sys->i_state = STATE_NOSYNC;
aout_DateSet( &p_sys->end_date, 0 );
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
p_sys->i_input_rate = INPUT_RATE_DEFAULT;
p_sys->b_latm_cfg = VLC_FALSE;
@ -368,7 +368,7 @@ static int ADTSSyncInfo( decoder_t * p_dec, const byte_t * p_buf,
/****************************************************************************
* LOAS helpers
****************************************************************************/
static int LOASSyncInfo( decoder_t *p_dec, uint8_t p_header[LOAS_HEADER_SIZE], unsigned int *pi_header_size )
static int LOASSyncInfo( uint8_t p_header[LOAS_HEADER_SIZE], unsigned int *pi_header_size )
{
*pi_header_size = 3;
return ( ( p_header[1] & 0x1f ) << 8 ) + p_header[2];
@ -999,7 +999,7 @@ static block_t *PacketizeStreamBlock( decoder_t *p_dec, block_t **pp_block )
}
/* Check if frame is valid and get frame info */
p_sys->i_frame_size = LOASSyncInfo( p_dec, p_header, &p_sys->i_header_size );
p_sys->i_frame_size = LOASSyncInfo( p_header, &p_sys->i_header_size );
}
if( p_sys->i_frame_size <= 0 )

View File

@ -66,7 +66,7 @@ struct decoder_sys_t
*/
block_bytestream_t bytestream;
int i_state;
int i_offset;
size_t i_offset;
uint8_t p_startcode[3];
/*
@ -167,7 +167,7 @@ static int Open( vlc_object_t *p_this )
/* Misc init */
p_sys->i_state = STATE_NOSYNC;
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
p_sys->p_startcode[0] = 0;
p_sys->p_startcode[1] = 0;
p_sys->p_startcode[2] = 1;
@ -367,7 +367,7 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
if( p_frag->p_buffer[3] >= 0x20 && p_frag->p_buffer[3] <= 0x2f )
{
/* Copy the complete VOL */
if( p_dec->fmt_out.i_extra != p_frag->i_buffer )
if( (size_t)p_dec->fmt_out.i_extra != p_frag->i_buffer )
{
p_dec->fmt_out.p_extra =
realloc( p_dec->fmt_out.p_extra, p_frag->i_buffer );

View File

@ -88,7 +88,7 @@ struct decoder_sys_t
*/
block_bytestream_t bytestream;
int i_state;
int i_offset;
size_t i_offset;
uint8_t p_startcode[3];
/* Sequence header and extension */
@ -166,7 +166,7 @@ static int Open( vlc_object_t *p_this )
/* Misc init */
p_sys->i_state = STATE_NOSYNC;
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
p_sys->p_startcode[0] = 0;
p_sys->p_startcode[1] = 0;
p_sys->p_startcode[2] = 1;

View File

@ -61,7 +61,7 @@ struct decoder_sys_t
*/
block_bytestream_t bytestream;
int i_state;
int i_offset;
size_t i_offset;
uint8_t p_startcode[3];
/* Current sequence header */
@ -137,7 +137,7 @@ static int Open( vlc_object_t *p_this )
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
p_sys->i_state = STATE_NOSYNC;
p_sys->bytestream = block_BytestreamInit( p_dec );
p_sys->bytestream = block_BytestreamInit();
p_sys->p_startcode[0] = 0x00;
p_sys->p_startcode[1] = 0x00;
p_sys->p_startcode[2] = 0x01;
@ -427,8 +427,8 @@ static block_t *ParseIDU( decoder_t *p_dec, block_t *p_frag )
if( i_ridu > 4 && (ridu[0]&0x80) == 0 ) /* for advanced profile, the first bit is 1 */
{
video_format_t *p_v = &p_dec->fmt_in.video;
const int i_potential_width = GetWBE( &ridu[0] );
const int i_potential_height = GetWBE( &ridu[2] );
const size_t i_potential_width = GetWBE( &ridu[0] );
const size_t i_potential_height = GetWBE( &ridu[2] );
if( i_potential_width >= 2 && i_potential_width <= 8192 &&
i_potential_height >= 2 && i_potential_height <= 8192 )
@ -494,7 +494,7 @@ static block_t *ParseIDU( decoder_t *p_dec, block_t *p_frag )
{64,33}, {160,99},{ 0, 0}, { 0, 0}
};
int i_ar = bs_read( &s, 4 );
int i_ar_w, i_ar_h;
unsigned i_ar_w, i_ar_h;
if( i_ar == 15 )
{