diff options
55 files changed, 136 insertions, 95 deletions
diff --git a/cfgparser.c b/cfgparser.c index 714f1d0300..38bb5e8a7a 100644 --- a/cfgparser.c +++ b/cfgparser.c @@ -763,7 +763,7 @@ static int config_read_option(m_config_t *config,config_t** conf_list, char *opt goto err_missing_param; if (sscanf(param, sizeof(off_t) == sizeof(int) ? - "%d%c" : "%lld%c", &tmp_off, &dummy) != 1) { + "%d%c" : "%lld%c", &tmp_off, (char *)&dummy) != 1) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "parameter must be an integer: %s\n", param); ret = ERR_OUT_OF_RANGE; goto out; diff --git a/cpudetect.c b/cpudetect.c index 6ed4015a10..cf466fb400 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -12,6 +12,7 @@ CpuCaps gCpuCaps; #ifdef ARCH_X86 #include <stdio.h> +#include <string.h> #ifdef __FreeBSD__ #include <sys/types.h> diff --git a/liba52/resample_mmx.c b/liba52/resample_mmx.c index 7cee365749..a4079798f7 100644 --- a/liba52/resample_mmx.c +++ b/liba52/resample_mmx.c @@ -13,7 +13,6 @@ static uint64_t __attribute__((aligned(8))) wm0101= 0x0000FFFF0000FFFFLL; static uint64_t __attribute__((aligned(8))) wm1100= 0xFFFFFFFF00000000LL; static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-512, %%esi \n\t" @@ -51,7 +50,6 @@ static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){ } static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; /* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it #ifdef HAVE_SSE @@ -100,7 +98,6 @@ static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){ } static int a52_resample_3F_to_5_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" @@ -156,7 +153,6 @@ static int a52_resample_3F_to_5_MMX(float * _f, int16_t * s16){ } static int a52_resample_2F_2R_to_4_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" @@ -208,7 +204,6 @@ static int a52_resample_2F_2R_to_4_MMX(float * _f, int16_t * s16){ } static int a52_resample_3F_2R_to_5_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" @@ -268,7 +263,6 @@ static int a52_resample_3F_2R_to_5_MMX(float * _f, int16_t * s16){ } static int a52_resample_MONO_LFE_to_6_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" @@ -309,7 +303,6 @@ static int a52_resample_MONO_LFE_to_6_MMX(float * _f, int16_t * s16){ } static int a52_resample_STEREO_LFE_to_6_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" @@ -348,7 +341,6 @@ static int a52_resample_STEREO_LFE_to_6_MMX(float * _f, int16_t * s16){ } static int a52_resample_3F_LFE_to_6_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" @@ -389,7 +381,6 @@ static int a52_resample_3F_LFE_to_6_MMX(float * _f, int16_t * s16){ } static int a52_resample_2F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" @@ -436,7 +427,6 @@ static int a52_resample_2F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){ } static int a52_resample_3F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){ - int i; int32_t * f = (int32_t *) _f; asm volatile( "movl $-1024, %%esi \n\t" diff --git a/libao2/ao_arts.c b/libao2/ao_arts.c index d660ebbcf3..9f012b551e 100644 --- a/libao2/ao_arts.c +++ b/libao2/ao_arts.c @@ -44,7 +44,7 @@ static int init(int rate_hz, int channels, int format, int flags) int err; int frag_spec; - if(err=arts_init()) { + if( (err=arts_init()) ) { mp_msg(MSGT_AO, MSGL_ERR, "AO: [arts] %s\n", arts_error_text(err)); return 0; } diff --git a/libao2/pl_eq.c b/libao2/pl_eq.c index 1799fd76c8..30e7a390ac 100644 --- a/libao2/pl_eq.c +++ b/libao2/pl_eq.c @@ -118,7 +118,7 @@ static void reset(){ // open & setup audio device // return: 1=success 0=fail static int init(){ - int c,k = 0; + int k = 0; float F[KM] = CF; // Check input format diff --git a/libao2/pl_resample.c b/libao2/pl_resample.c index 8cecb7bce8..d948ba6e7b 100644 --- a/libao2/pl_resample.c +++ b/libao2/pl_resample.c @@ -160,6 +160,10 @@ static void uninit(){ static void reset(){ } +/* forward declarations */ +int upsample(); +int downsample(); + // processes 'ao_plugin_data.len' bytes of 'data' // called for every block of data // FIXME: this routine needs to be optimized (it is probably possible to do a lot here) diff --git a/libao2/pl_surround.c b/libao2/pl_surround.c index dad0cbafcf..a7e629b0e3 100644 --- a/libao2/pl_surround.c +++ b/libao2/pl_surround.c @@ -173,7 +173,7 @@ static double steering_matrix[][12] = { }; // Experimental moving average dominances -static int amp_L = 0, amp_R = 0, amp_C = 0, amp_S = 0; +//static int amp_L = 0, amp_R = 0, amp_C = 0, amp_S = 0; // processes 'ao_plugin_data.len' bytes of 'data' // called for every block of data diff --git a/libmpcodecs/ad_acm.c b/libmpcodecs/ad_acm.c index 32ee3798ac..a665b264c2 100644 --- a/libmpcodecs/ad_acm.c +++ b/libmpcodecs/ad_acm.c @@ -39,11 +39,13 @@ static int init(sh_audio_t *sh_audio) return 1; } +extern void print_wave_header(WAVEFORMATEX *h); + static int preinit(sh_audio_t *sh_audio) { HRESULT ret; WAVEFORMATEX *in_fmt = sh_audio->wf; - unsigned int srcsize = 0; + DWORD srcsize = 0; acm_context_t *priv; priv = malloc(sizeof(acm_context_t)); diff --git a/libmpcodecs/ad_qtaudio.c b/libmpcodecs/ad_qtaudio.c index bf4b39d0fe..f5dd76ec13 100644 --- a/libmpcodecs/ad_qtaudio.c +++ b/libmpcodecs/ad_qtaudio.c @@ -192,11 +192,11 @@ static int preinit(sh_audio_t *sh){ WantedBufferSize=OutputFormatInfo.numChannels*OutputFormatInfo.sampleRate*2; error = SoundConverterGetBufferSizes(myConverter, WantedBufferSize,&FramesToGet,&InputBufferSize,&OutputBufferSize); - printf("SoundConverterGetBufferSizes:%i\n"); - printf("WantedBufferSize = %i\n",WantedBufferSize); - printf("InputBufferSize = %i\n",InputBufferSize); - printf("OutputBufferSize = %i\n",OutputBufferSize); - printf("FramesToGet = %i\n",FramesToGet); + printf("SoundConverterGetBufferSizes:%i\n",error); + printf("WantedBufferSize = %li\n",WantedBufferSize); + printf("InputBufferSize = %li\n",InputBufferSize); + printf("OutputBufferSize = %li\n",OutputBufferSize); + printf("FramesToGet = %li\n",FramesToGet); InFrameSize=InputBufferSize/FramesToGet; OutFrameSize=OutputBufferSize/FramesToGet; @@ -256,7 +256,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) InputBufferSize=FramesToGet*InFrameSize; - printf("FramesToGet = %i (%i -> %i bytes)\n",FramesToGet, + printf("FramesToGet = %li (%li -> %li bytes)\n",FramesToGet, InputBufferSize, FramesToGet*OutFrameSize); if(InputBufferSize>sh->a_in_buffer_len){ @@ -270,8 +270,8 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) error = SoundConverterConvertBuffer(myConverter,sh->a_in_buffer, FramesToGet,buf,&ConvertedFrames,&ConvertedBytes); printf("SoundConverterConvertBuffer:%i\n",error); - printf("ConvertedFrames = %i\n",ConvertedFrames); - printf("ConvertedBytes = %i\n",ConvertedBytes); + printf("ConvertedFrames = %li\n",ConvertedFrames); + printf("ConvertedBytes = %li\n",ConvertedBytes); InputBufferSize=(ConvertedBytes/OutFrameSize)*InFrameSize; // FIXME!! sh->a_in_buffer_len-=InputBufferSize; diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c index df791abbf3..60d536e043 100644 --- a/libmpcodecs/dec_audio.c +++ b/libmpcodecs/dec_audio.c @@ -45,7 +45,6 @@ void afm_help(){ int init_audio_codec(sh_audio_t *sh_audio) { - unsigned i; // reset in/out buffer size/pointer: sh_audio->a_buffer_size=0; @@ -166,6 +165,8 @@ int init_audio(sh_audio_t *sh_audio,char* codecname,char* afm,int status){ return 0; } +extern char *get_path(char *filename); + int init_best_audio_codec(sh_audio_t *sh_audio,char** audio_codec_list,char** audio_fm_list){ char* ac_l_default[2]={"",(char*)NULL}; // hack: diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 7af07541ee..fd93031494 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -202,6 +202,8 @@ int init_video(sh_video_t *sh_video,char* codecname,char* vfm,int status){ return 0; } +extern char *get_path(char *filename); + int init_best_video_codec(sh_video_t *sh_video,char** video_codec_list,char** video_fm_list){ char* vc_l_default[2]={"",(char*)NULL}; // hack: diff --git a/libmpcodecs/native/qtrpza.c b/libmpcodecs/native/qtrpza.c index 024bca5b42..6f0db5f921 100644 --- a/libmpcodecs/native/qtrpza.c +++ b/libmpcodecs/native/qtrpza.c @@ -130,7 +130,6 @@ void qt_decode_rpza(char *encoded, int encoded_size, char *decoded, int width, int height, int bytes_per_pixel) { - int i; int stream_ptr = 0; int chunk_size; unsigned char opcode; @@ -145,7 +144,6 @@ void qt_decode_rpza(char *encoded, int encoded_size, char *decoded, int width, int pixel_ptr = 0; int pixel_x, pixel_y; int row_inc = bytes_per_pixel * (width - 4); - int max_height = row_inc * height; int block_x_inc = bytes_per_pixel * 4; int block_y_inc = bytes_per_pixel * width; int block_ptr; diff --git a/libmpcodecs/vd_lzo.c b/libmpcodecs/vd_lzo.c index d475b8256b..56fa36eddf 100644 --- a/libmpcodecs/vd_lzo.c +++ b/libmpcodecs/vd_lzo.c @@ -98,10 +98,8 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags) { static int init_done = 0; int r; - int cb = 1; - int cr = 2; mp_image_t* mpi; - int w, h; + int w; lzo_context_t *priv = sh->context; if (len <= 0) { diff --git a/libmpcodecs/vd_vfw.c b/libmpcodecs/vd_vfw.c index 9d6e82ce6e..f3f77da9a7 100644 --- a/libmpcodecs/vd_vfw.c +++ b/libmpcodecs/vd_vfw.c @@ -138,6 +138,8 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ return CONTROL_UNKNOWN; } +extern void print_video_header(BITMAPINFOHEADER *h); + // init driver static int init(sh_video_t *sh){ HRESULT ret; diff --git a/libmpcodecs/ve_vfw.c b/libmpcodecs/ve_vfw.c index b97845d14d..868fb6a385 100644 --- a/libmpcodecs/ve_vfw.c +++ b/libmpcodecs/ve_vfw.c @@ -74,9 +74,9 @@ static BITMAPINFOHEADER* vfw_open_encoder(char *dll_name, BITMAPINFOHEADER *inpu ICINFO icinfo; ret = ICGetInfo(encoder_hic, &icinfo, sizeof(ICINFO)); - printf("%d - %d - %d\n", ret, icinfo.dwSize, sizeof(ICINFO)); -printf("Compressor type: %.4x\n", icinfo.fccType); -printf("Compressor subtype: %.4x\n", icinfo.fccHandler); + printf("%ld - %ld - %d\n", ret, icinfo.dwSize, sizeof(ICINFO)); +printf("Compressor type: %.4lx\n", icinfo.fccType); +printf("Compressor subtype: %.4lx\n", icinfo.fccHandler); printf("Compressor flags: %lu, version %lu, ICM version: %lu\n", icinfo.dwFlags, icinfo.dwVersion, icinfo.dwVersionICM); //printf("Compressor name: %s\n", icinfo.szName); @@ -130,21 +130,21 @@ static int vfw_start_encoder(BITMAPINFOHEADER *input_bih, BITMAPINFOHEADER *outp // if(verbose) { printf("Starting compression:\n"); printf(" Input format:\n"); - printf(" biSize %ld\n", input_bih->biSize); - printf(" biWidth %ld\n", input_bih->biWidth); - printf(" biHeight %ld\n", input_bih->biHeight); + printf(" biSize %d\n", input_bih->biSize); + printf(" biWidth %d\n", input_bih->biWidth); + printf(" biHeight %d\n", input_bih->biHeight); printf(" biPlanes %d\n", input_bih->biPlanes); printf(" biBitCount %d\n", input_bih->biBitCount); - printf(" biCompression 0x%lx ('%.4s')\n", input_bih->biCompression, (char *)&input_bih->biCompression); - printf(" biSizeImage %ld\n", input_bih->biSizeImage); + printf(" biCompression 0x%x ('%.4s')\n", input_bih->biCompression, (char *)&input_bih->biCompression); + printf(" biSizeImage %d\n", input_bih->biSizeImage); printf(" Output format:\n"); - printf(" biSize %ld\n", output_bih->biSize); - printf(" biWidth %ld\n", output_bih->biWidth); - printf(" biHeight %ld\n", output_bih->biHeight); + printf(" biSize %d\n", output_bih->biSize); + printf(" biWidth %d\n", output_bih->biWidth); + printf(" biHeight %d\n", output_bih->biHeight); printf(" biPlanes %d\n", output_bih->biPlanes); printf(" biBitCount %d\n", output_bih->biBitCount); - printf(" biCompression 0x%lx ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression); - printf(" biSizeImage %ld\n", output_bih->biSizeImage); + printf(" biCompression 0x%x ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression); + printf(" biSizeImage %d\n", output_bih->biSizeImage); // } output_bih->biWidth=input_bih->biWidth; @@ -165,13 +165,13 @@ static int vfw_start_encoder(BITMAPINFOHEADER *input_bih, BITMAPINFOHEADER *outp mp_msg(MSGT_WIN32,MSGL_V,"ICCompressBegin OK\n"); printf(" Output format after query/begin:\n"); - printf(" biSize %ld\n", output_bih->biSize); - printf(" biWidth %ld\n", output_bih->biWidth); - printf(" biHeight %ld\n", output_bih->biHeight); + printf(" biSize %d\n", output_bih->biSize); + printf(" biWidth %d\n", output_bih->biWidth); + printf(" biHeight %d\n", output_bih->biHeight); printf(" biPlanes %d\n", output_bih->biPlanes); printf(" biBitCount %d\n", output_bih->biBitCount); - printf(" biCompression 0x%lx ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression); - printf(" biSizeImage %ld\n", output_bih->biSizeImage); + printf(" biCompression 0x%x ('%.4s')\n", output_bih->biCompression, (char *)&output_bih->biCompression); + printf(" biSizeImage %d\n", output_bih->biSizeImage); encoder_buf_size=input_bih->biSizeImage; encoder_buf=malloc(encoder_buf_size); diff --git a/libmpcodecs/ve_xvid.c b/libmpcodecs/ve_xvid.c index 8ffd8baf75..d3dde28039 100644 --- a/libmpcodecs/ve_xvid.c +++ b/libmpcodecs/ve_xvid.c @@ -50,6 +50,7 @@ static int const divx4_general_presets[7] = { }; extern char* passtmpfile; +extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags); static int xvidenc_pass = 0; static int xvidenc_quality = sizeof(divx4_motion_presets) / sizeof(divx4_motion_presets[0]) - 1; /* best quality */ @@ -136,7 +137,10 @@ config(struct vf_instance_s* vf, enc_param.rc_buffer = xvidenc_rc_buffer; enc_param.min_quantizer = xvidenc_min_quantizer; enc_param.max_quantizer = xvidenc_max_quantizer; - enc_param.max_key_interval = xvidenc_max_key_interval; + if( xvidenc_max_key_interval > 0 ) + enc_param.max_key_interval = xvidenc_max_key_interval; + else + enc_param.max_key_interval = 10 * enc_param.fbase / enc_param.fincr; switch (xvid_encore(NULL, XVID_ENC_CREATE, &enc_param, NULL)) { case XVID_ERR_FAIL: mp_msg(MSGT_MENCODER,MSGL_ERR, "xvid: encoder creation failed\n"); diff --git a/libmpcodecs/vf_1bpp.c b/libmpcodecs/vf_1bpp.c index b5bbd32889..2d6a959dc9 100644 --- a/libmpcodecs/vf_1bpp.c +++ b/libmpcodecs/vf_1bpp.c @@ -165,7 +165,6 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){ } static int open(vf_instance_t *vf, char* args){ - unsigned int i; vf->config=config; vf->put_image=put_image; vf->query_format=query_format; diff --git a/libmpcodecs/vf_2xsai.c b/libmpcodecs/vf_2xsai.c index 243290f4b5..20db798722 100644 --- a/libmpcodecs/vf_2xsai.c +++ b/libmpcodecs/vf_2xsai.c @@ -130,7 +130,6 @@ void Super2xSaI_ex(uint8 *src, uint32 src_pitch, uint8 *dst, uint32 dst_pitch, uint32 width, uint32 height, int sbpp) { - int j; unsigned int x, y; unsigned long color[16]; diff --git a/libmpcodecs/vf_boxblur.c b/libmpcodecs/vf_boxblur.c index 2ce971a62a..a5e7f9767a 100644 --- a/libmpcodecs/vf_boxblur.c +++ b/libmpcodecs/vf_boxblur.c @@ -177,7 +177,6 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){ } static int open(vf_instance_t *vf, char* args){ - char *pos, *max; int e; vf->config=config; diff --git a/libmpcodecs/vf_il.c b/libmpcodecs/vf_il.c index 0f7e3e6625..d4e9a840db 100644 --- a/libmpcodecs/vf_il.c +++ b/libmpcodecs/vf_il.c @@ -49,7 +49,7 @@ struct vf_priv_s { /***************************************************************************/ -static int interleave(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int interleave, int swap){ +static void interleave(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int interleave, int swap){ const int a= swap; const int b= 1-a; const int m= h>>1; @@ -124,7 +124,6 @@ static void parse(FilterParam *fp, char* args){ } static int open(vf_instance_t *vf, char* args){ - char *pos, *max; vf->put_image=put_image; // vf->get_image=get_image; diff --git a/libmpcodecs/vf_pp.c b/libmpcodecs/vf_pp.c index a09b89440f..c82ece5798 100644 --- a/libmpcodecs/vf_pp.c +++ b/libmpcodecs/vf_pp.c @@ -8,6 +8,10 @@ #include "../mp_msg.h" #include "../cpudetect.h" +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif + #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpdemux/aviprint.c b/libmpdemux/aviprint.c index 87d02ea350..bdca364c36 100644 --- a/libmpdemux/aviprint.c +++ b/libmpdemux/aviprint.c @@ -64,7 +64,7 @@ void print_wave_header(WAVEFORMATEX *h){ if(h->wFormatTag==0x55 && h->cbSize>=12){ MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h; printf("mp3.wID=%d\n",h2->wID); - printf("mp3.fdwFlags=0x%X\n",h2->fdwFlags); + printf("mp3.fdwFlags=0x%lX\n",h2->fdwFlags); printf("mp3.nBlockSize=%d\n",h2->nBlockSize); printf("mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock); printf("mp3.nCodecDelay=%d\n",h2->nCodecDelay); @@ -83,13 +83,13 @@ void print_wave_header(WAVEFORMATEX *h){ void print_video_header(BITMAPINFOHEADER *h){ printf("======= VIDEO Format ======\n"); - printf(" biSize %ld\n", h->biSize); - printf(" biWidth %ld\n", h->biWidth); - printf(" biHeight %ld\n", h->biHeight); + printf(" biSize %d\n", h->biSize); + printf(" biWidth %d\n", h->biWidth); + printf(" biHeight %d\n", h->biHeight); printf(" biPlanes %d\n", h->biPlanes); printf(" biBitCount %d\n", h->biBitCount); - printf(" biCompression %ld='%.4s'\n", h->biCompression, (char *)&h->biCompression); - printf(" biSizeImage %ld\n", h->biSizeImage); + printf(" biCompression %d='%.4s'\n", h->biCompression, (char *)&h->biCompression); + printf(" biSizeImage %d\n", h->biSizeImage); printf("===========================\n"); } diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c index c2b61a8731..37011bd8fd 100644 --- a/libmpdemux/demux_asf.c +++ b/libmpdemux/demux_asf.c @@ -232,7 +232,7 @@ int demux_asf_fill_buffer(demuxer_t *demux){ unsigned int rlen; // int len; - unsigned int time2; + unsigned int time2=0; int keyframe=0; if(p>=p_end) mp_msg(MSGT_DEMUX,MSGL_V,"Warning! invalid packet 1, sig11 coming soon...\n"); @@ -344,6 +344,9 @@ int demux_asf_fill_buffer(demuxer_t *demux){ #include "stheader.h" +extern void resync_audio_stream(sh_audio_t *sh_audio); +extern void skip_audio_frame(sh_audio_t *sh_audio); + void demux_seek_asf(demuxer_t *demuxer,float rel_seek_secs,int flags){ demux_stream_t *d_audio=demuxer->audio; demux_stream_t *d_video=demuxer->video; diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c index c0480b3af4..bc7c6308bd 100644 --- a/libmpdemux/demux_audio.c +++ b/libmpdemux/demux_audio.c @@ -28,6 +28,7 @@ typedef struct da_priv { extern void free_sh_audio(sh_audio_t* sh); extern void resync_audio_stream(sh_audio_t *sh_audio); +extern void print_wave_header(WAVEFORMATEX *h); int hr_mp3_seek = 0; diff --git a/libmpdemux/demux_avi.c b/libmpdemux/demux_avi.c index 567217a82c..2394179b51 100644 --- a/libmpdemux/demux_avi.c +++ b/libmpdemux/demux_avi.c @@ -566,6 +566,7 @@ demuxer_t* demux_open_avi(demuxer_t* demuxer){ } //extern float initial_pts_delay; +extern void resync_audio_stream(sh_audio_t *sh_audio); void demux_seek_avi(demuxer_t *demuxer,float rel_seek_secs,int flags){ avi_priv_t *priv=demuxer->priv; diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c index a2410c0217..5437d8a0e5 100644 --- a/libmpdemux/demux_mpg.c +++ b/libmpdemux/demux_mpg.c @@ -345,6 +345,9 @@ do{ return 1; } +extern void resync_audio_stream(sh_audio_t *sh_audio); +extern void skip_audio_frame(sh_audio_t *sh_audio); + void demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags){ demux_stream_t *d_audio=demuxer->audio; demux_stream_t *d_video=demuxer->video; diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c index dd644429ca..60ad9482a9 100644 --- a/libmpdemux/demux_ogg.c +++ b/libmpdemux/demux_ogg.c @@ -440,6 +440,9 @@ void demux_ogg_build_syncpoints_table(demuxer_t* demuxer) { } +extern void print_wave_header(WAVEFORMATEX *h); +extern void print_video_header(BITMAPINFOHEADER *h); + /// Open an ogg physical stream int demux_ogg_open(demuxer_t* demuxer) { ogg_demuxer_t* ogg_d; @@ -869,6 +872,8 @@ demuxer_t* init_avi_with_ogg(demuxer_t* demuxer) { } +extern void resync_audio_stream(sh_audio_t *sh_audio); + void demux_ogg_seek(demuxer_t *demuxer,float rel_seek_secs,int flags) { ogg_demuxer_t* ogg_d = demuxer->priv; ogg_sync_state* sync = &ogg_d->sync; diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c index b774aa29ef..4988cc9633 100644 --- a/libmpdemux/demux_real.c +++ b/libmpdemux/demux_real.c @@ -660,6 +660,8 @@ got_video: }// goto loop; } +extern void print_wave_header(WAVEFORMATEX *h); + void demux_open_real(demuxer_t* demuxer) { real_priv_t* priv = demuxer->priv; diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index c53c1628a4..29a6d54e0d 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -522,6 +522,7 @@ extern int y4m_check_file(demuxer_t *demuxer); extern void demux_open_y4m(demuxer_t *demuxer); extern int roq_check_file(demuxer_t *demuxer); extern int pva_check_file(demuxer_t * demuxer); +extern demuxer_t * demux_open_pva(demuxer_t * demuxer); extern int real_check_file(demuxer_t *demuxer); extern void demux_open_real(demuxer_t *demuxer); extern int nuv_check_file(demuxer_t *demuxer); @@ -531,6 +532,7 @@ extern int demux_ogg_open(demuxer_t* demuxer); extern int demux_rawaudio_open(demuxer_t* demuxer); extern int smjpeg_check_file(demuxer_t *demuxer); extern int demux_open_smjpeg(demuxer_t* demuxer); +extern int bmp_check_file(demuxer_t *demuxer); extern demuxer_t* init_avi_with_ogg(demuxer_t* demuxer); diff --git a/libmpdemux/open.c b/libmpdemux/open.c index 0e1f9523d7..72bf95543d 100644 --- a/libmpdemux/open.c +++ b/libmpdemux/open.c @@ -22,6 +22,7 @@ #ifdef STREAMING #include "url.h" #include "network.h" +extern int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url); #ifdef STREAMING_LIVE_DOT_COM #include "demux_rtp.h" int isSDPFile = 0; @@ -531,7 +532,7 @@ if(dvd_title){ int dvd_parse_chapter_range(struct config *conf, const char *range){ const char *s; char *t; - conf; /* prevent warning from GCC */ +/* conf; prevent warning from GCC */ s = range; dvd_chapter = 1; dvd_last_chapter = 0; diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c index 082bac691f..5c3b05bb13 100644 --- a/libmpdemux/tv.c +++ b/libmpdemux/tv.c @@ -108,6 +108,10 @@ int demux_tv_fill_buffer(demuxer_t *demux, demux_stream_t *ds) return 1; } + /* forward declarations */ +int tv_set_freq(tvi_handle_t *tvh, unsigned long freq); +int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq); + static int open_tv(tvi_handle_t *tvh) { int i; diff --git a/libmpdemux/tvi_def.h b/libmpdemux/tvi_def.h index aaa1f68c85..8e84ad1493 100644 --- a/libmpdemux/tvi_def.h +++ b/libmpdemux/tvi_def.h @@ -1,4 +1,5 @@ #include <stdlib.h> /* malloc */ +#include <string.h> /* memset */ static int init(priv_t *priv); static int uninit(priv_t *priv); diff --git a/libmpdvdkit2/css.c b/libmpdvdkit2/css.c index 8e073b150c..83fcec8317 100644 --- a/libmpdvdkit2/css.c +++ b/libmpdvdkit2/css.c @@ -301,7 +301,7 @@ int _dvdcss_title ( dvdcss_t dvdcss, int i_block ) if(dvdcss->psz_cache){ int fd; key_file=malloc(strlen(dvdcss->psz_cache)+12+4); - sprintf(key_file,"%s/%0.10x",dvdcss->psz_cache,i_block); + sprintf(key_file,"%s/%.10x",dvdcss->psz_cache,i_block); if ( (fd=open( key_file,O_RDONLY ) ) > 0 ){ if(read(fd, p_title_key, 5)==5){ // success! diff --git a/libmpdvdkit2/libdvdcss.c b/libmpdvdkit2/libdvdcss.c index 4e715f1f5c..2a162c4888 100644 --- a/libmpdvdkit2/libdvdcss.c +++ b/libmpdvdkit2/libdvdcss.c @@ -269,7 +269,7 @@ extern dvdcss_t dvdcss_open ( char *psz_target ) /* if the CACHE is enabled, extract some unique disc ID */ if(dvdcss_cache_dir){ char* disc_id=NULL; - char title_name[64]; + /*char title_name[64];*/ char sector[DVDCSS_BLOCK_SIZE]; // 32768+40 -> disc title (32 uppercase chars) // 32768+813 -> disc manufacturing date + serial no (16 digit number) @@ -289,14 +289,14 @@ extern dvdcss_t dvdcss_open ( char *psz_target ) for ( i=0;i<16;i++ ) if ( ( title_name[i] < '0' )||( title_name[i] > '9' ) ){ disc_id=malloc(16+4); - sprintf( disc_id,"%0.2X%0.2X%0.2X%0.2X%0.2X%0.2X%0.2X%0.2X",title_name[0],title_name[1],title_name[2],title_name[3],title_name[4],title_name[5],title_name[6],title_name[7] ); + sprintf( disc_id,"%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X",title_name[0],title_name[1],title_name[2],title_name[3],title_name[4],title_name[5],title_name[6],title_name[7] ); break; } if(!disc_id) disc_id=strdup(title_name); } if(disc_id){ // yeah, we have a disc name/id, let's set up cache path: - char* dir; + /*char* dir;*/ dvdcss->psz_cache = malloc(strlen(dvdcss_cache_dir)+strlen(disc_id)+4); sprintf(dvdcss->psz_cache,"%s/%s",dvdcss_cache_dir,disc_id); mkdir( dvdcss->psz_cache,493 ); diff --git a/libvo/aclib.c b/libvo/aclib.c index 858c77495a..bd089f6e34 100644 --- a/libvo/aclib.c +++ b/libvo/aclib.c @@ -9,6 +9,7 @@ */ #include <stddef.h> #include "../cpudetect.h" +#include "fastmemcpy.h" #define BLOCK_SIZE 4096 #define CONFUSION_FACTOR 0 @@ -177,6 +178,7 @@ void * mem2agpcpy(void * to, const void * from, size_t len) #endif #endif //!RUNTIME_CPUDETECT + return to; } #endif /* use fastmemcpy */ diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 72770f2f52..b829f6d00e 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -732,7 +732,7 @@ static FT_ULong decode_char(iconv_t *cd, char c) { int inbytesleft = 1; int outbytesleft = sizeof(FT_ULong); - size_t count = iconv(*cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + iconv(*cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); /* convert unicode BigEndian -> MachineEndian */ o = be2me_32(o); @@ -785,7 +785,9 @@ static int prepare_charset(char *charmap, char *encoding, FT_ULong *charset, FT_ } static int prepare_charset_unicode(FT_Face face, FT_ULong *charset, FT_ULong *charcodes) { +#ifdef HAVE_FREETYPE21 FT_ULong charcode; +#endif FT_UInt gindex; int i,j; diff --git a/libvo/geometry.c b/libvo/geometry.c index 26afd69547..1823a7b4c2 100644 --- a/libvo/geometry.c +++ b/libvo/geometry.c @@ -2,7 +2,9 @@ #include "geometry.h" #include "../mp_msg.h" +// #include "../mplayer.h" /* exit_player() */ #include <string.h> +#include <stdlib.h> /* strtol */ /* A string of the form xpos[%]:ypos[%] */ char *vo_geometry = NULL; @@ -53,7 +55,7 @@ int geometry(int *xpos, int *ypos, int scrw, int scrh, int vidw, int vidh, int f return geometry_error(); } - if(*colpos != '\0') + if(*colpos != '\0') { if(vo_geometry[glen - 1] == '%') { if(!get_num(colpos + 1, &yper, vo_geometry + glen - 1)) return geometry_error(); @@ -61,6 +63,7 @@ int geometry(int *xpos, int *ypos, int scrw, int scrh, int vidw, int vidh, int f if(!get_num(colpos + 1, ypos, vo_geometry + glen)) return geometry_error(); } + } if(xper) *xpos = (scrw - vidw) * ((float)xper / 100.0); diff --git a/libvo/mga_common.c b/libvo/mga_common.c index cc9e59b47f..193569fdf0 100644 --- a/libvo/mga_common.c +++ b/libvo/mga_common.c @@ -16,7 +16,10 @@ static mga_vid_config_t mga_vid_config; static uint8_t *vid_data, *frames[4]; static int f = -1; -static uint32_t drwX,drwY,drwWidth,drwHeight,drwBorderWidth,drwDepth; +static uint32_t drwX,drwY,drwWidth,drwHeight; +#ifdef VO_XMGA +static uint32_t drwBorderWidth,drwDepth; +#endif static uint32_t drwcX,drwcY,dwidth,dheight; static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ @@ -324,7 +327,7 @@ static uint32_t control(uint32_t request, void *data, ...) case VOCTRL_SET_PANSCAN: if ( vo_fs && ( vo_panscan != vo_panscan_amount ) ) // || ( !vo_fs && vo_panscan_amount ) ) { - int old_y = vo_panscan_y; +// int old_y = vo_panscan_y; panscan_calc(); // if ( old_y != vo_panscan_y ) set_window(); diff --git a/libvo/sub.c b/libvo/sub.c index 90dd6c6869..67003cf9a1 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -4,6 +4,10 @@ #include <string.h> #include "config.h" +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif + #include "mp_msg.h" #include "video_out.h" #include "font_load.h" @@ -434,7 +438,6 @@ inline static void vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){ inline static void vo_update_spudec_sub(mp_osd_obj_t* obj, int dxs, int dys) { unsigned int bbox[4]; - int i; spudec_calc_bbox(vo_spudec, dxs, dys, bbox); obj->bbox.x1 = bbox[0]; obj->bbox.x2 = bbox[1]; diff --git a/libvo/vo_dga.c b/libvo/vo_dga.c index 9abb50fbc3..8b0d3962f3 100644 --- a/libvo/vo_dga.c +++ b/libvo/vo_dga.c @@ -246,9 +246,6 @@ static int vo_dga_src_height; // height of video in pixels static int vo_dga_src_offset=0; // offset in src static int vo_dga_vp_offset=0; // offset in dest static int vo_dga_bytes_per_line; // bytes per line to copy -static int vo_dga_src_skip; // bytes to skip after copying one - // line - // (not supported yet) in src static int vo_dga_vp_skip; // dto. for dest static int vo_dga_lines; // num of lines to copy static int vo_dga_hw_mode = 0; // index in mode list that is actually @@ -333,7 +330,6 @@ static void fillblock(char *strt, int yoff, int lines, int val){ static uint32_t draw_frame( uint8_t *src[] ){ int vp_skip = vo_dga_vp_skip; - int lpl = vo_dga_bytes_per_line >> 2; int numlines = vo_dga_lines; char *s, *d; @@ -366,7 +362,6 @@ static uint32_t draw_frame( uint8_t *src[] ){ case VDM_CONV_15TO16: { int i; - char *e; for(i=0; i< vo_dga_lines; i++){ rgb15to16( s, d, vo_dga_bytes_per_line); d+=vo_dga_bytes_per_line; @@ -400,7 +395,7 @@ static uint32_t draw_frame( uint8_t *src[] ){ static void check_events(void) { - int e=vo_x11_check_events(mDisplay); + vo_x11_check_events(mDisplay); } //--------------------------------------------------------- diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c index ad15b0bb2f..0d187ed974 100644 --- a/libvo/vo_dxr3.c +++ b/libvo/vo_dxr3.c @@ -108,9 +108,11 @@ #include <stdio.h> #include <time.h> #include <math.h> -#include <malloc.h> #include "config.h" +#ifdef HAVE_MALLOC_H +#include <malloc.h> +#endif #include "fastmemcpy.h" #include "video_out.h" diff --git a/libvo/vo_gif89a.c b/libvo/vo_gif89a.c index f883612651..4cb9b8b0ad 100644 --- a/libvo/vo_gif89a.c +++ b/libvo/vo_gif89a.c @@ -120,6 +120,9 @@ static const vo_info_t* get_info(void) return &vo_info; } +/* forward declaration */ +int gif_reduce(int width, int height, unsigned char *source, unsigned char *destination, unsigned char *palette); + static uint32_t draw_frame(uint8_t * src[]) { uint8_t *use_data; diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index a10567ed84..2a12f555c5 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -15,6 +15,7 @@ #include "config.h" #include "video_out.h" #include "video_out_internal.h" +#include "sub.h" LIBVO_EXTERN(gl2) @@ -61,14 +62,6 @@ static unsigned char *ImageData=NULL; //static int texture_id=1; static GLXContext wsGLXContext; -static int wsGLXAttrib[] = { GLX_RGBA, - GLX_RED_SIZE,1, - GLX_GREEN_SIZE,1, - GLX_BLUE_SIZE,1, - GLX_ALPHA_SIZE,0, - GLX_DOUBLEBUFFER, - None }; - static uint32_t image_width; static uint32_t image_height; @@ -606,7 +599,7 @@ static int choose_glx_visual(Display *dpy, int scr, XVisualInfo *res_vi) template.screen = scr; vi_list = XGetVisualInfo(dpy, VisualScreenMask, &template, &vi_num); if (!vi_list) return -1; - best_weight = 1000000; + best_weight = 1000000; best_i=0; for (i = 0; i < vi_num; i++) { int val, res, w = 0; /* of course, the visual must support OpenGL rendering... */ diff --git a/libvo/vo_null.c b/libvo/vo_null.c index a977b66c4a..9cec3f96c7 100644 --- a/libvo/vo_null.c +++ b/libvo/vo_null.c @@ -23,6 +23,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <errno.h> #include "config.h" #include "video_out.h" diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c index e911a117b4..ef2b7f0faf 100644 --- a/libvo/vo_sdl.c +++ b/libvo/vo_sdl.c @@ -1139,8 +1139,6 @@ static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int { struct sdl_priv_s *priv = &sdl_priv; uint8_t *dst; - uint8_t *src; - int i; SDL_OVR_LOCK(-1) @@ -1195,7 +1193,6 @@ static void check_events (void) struct sdl_priv_s *priv = &sdl_priv; SDL_Event event; SDLKey keypressed = 0; - static int modifiers = 0; /* Poll the waiting SDL Events */ while ( SDL_PollEvent(&event) ) { diff --git a/libvo/vo_tdfxfb.c b/libvo/vo_tdfxfb.c index f74a25fd30..443972a849 100644 --- a/libvo/vo_tdfxfb.c +++ b/libvo/vo_tdfxfb.c @@ -43,6 +43,7 @@ #include "video_out_internal.h" #include "drivers/3dfx.h" #include "aspect.h" +#include "sub.h" LIBVO_EXTERN(tdfxfb) diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c index 19fd6e1981..df149e987a 100644 --- a/libvo/vo_xvidix.c +++ b/libvo/vo_xvidix.c @@ -195,7 +195,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { XVisualInfo vinfo; - XSizeHints hint; +// XSizeHints hint; XSetWindowAttributes xswa; unsigned long xswamask; XWindowAttributes attribs; diff --git a/libvo/vosub_vidix.h b/libvo/vosub_vidix.h index 7a68bcfe0c..0fe70a63c8 100644 --- a/libvo/vosub_vidix.h +++ b/libvo/vosub_vidix.h @@ -21,6 +21,7 @@ int vidix_init(unsigned src_width,unsigned src_height, int vidix_start(void); int vidix_stop(void); void vidix_term( void ); +uint32_t vidix_control(uint32_t request, void *data, ...); uint32_t vidix_query_fourcc(unsigned fourcc); uint32_t vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y); diff --git a/libvo/x11_common.c b/libvo/x11_common.c index dd9c17de3b..fc6e08641d 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1103,6 +1103,7 @@ uint32_t vo_x11_get_equalizer(char *name, int *value) else if (!strcasecmp(name, "contrast")) *value = vo_contrast; else if (!strcasecmp(name, "gamma")) *value = vo_gamma; else return VO_NOTIMPL; + return VO_TRUE; } diff --git a/mencoder.c b/mencoder.c index 8e10096669..ff7989a06a 100644 --- a/mencoder.c +++ b/mencoder.c @@ -289,6 +289,7 @@ void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags){ aviwrite_write_chunk(muxer,s,muxer_f,len,flags); } +extern void print_wave_header(WAVEFORMATEX *h); int main(int argc,char* argv[]){ @@ -684,7 +685,7 @@ case ACODEC_COPY: mux_a->h.dwScale=mux_a->h.dwSampleSize; mux_a->h.dwRate=mux_a->wf->nAvgBytesPerSec; } - printf("audiocodec: framecopy (format=%x chans=%d rate=%d bits=%d bps=%d sample=%d)\n", + printf("audiocodec: framecopy (format=%x chans=%d rate=%ld bits=%d bps=%ld sample=%ld)\n", mux_a->wf->wFormatTag, mux_a->wf->nChannels, mux_a->wf->nSamplesPerSec, mux_a->wf->wBitsPerSample, mux_a->wf->nAvgBytesPerSec, mux_a->h.dwSampleSize); break; @@ -1194,7 +1195,7 @@ if(sh_audio && mux_a->codec==ACODEC_VBRMP3 && !lame_param_vbr){ mux_a->h.dwRate=mux_a->wf->nAvgBytesPerSec; mux_a->h.dwScale=1; mux_a->wf->nBlockAlign=1; - printf("\n\nCBR audio: %d bytes/sec, %d bytes/block\n", + printf("\n\nCBR audio: %ld bytes/sec, %d bytes/block\n", mux_a->h.dwRate,((MPEGLAYER3WAVEFORMAT*)(mux_a->wf))->nBlockSize); } #endif @@ -129,6 +129,8 @@ static int max_framesize=0; #include "libmpcodecs/dec_video.h" //#include "libmpcodecs/vf.h" +extern void vf_list_plugins(); + //**************************************************************************// //**************************************************************************// @@ -381,6 +383,10 @@ static void uninit_player(unsigned int mask){ current_module=NULL; } +#ifdef X11_FULLSCREEN +extern void vo_uninit( void ); +#endif + void exit_player(char* how){ uninit_player(INITED_ALL); diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c index fd50d73a9e..fdb499d018 100644 --- a/postproc/rgb2rgb.c +++ b/postproc/rgb2rgb.c @@ -13,6 +13,7 @@ #include "../cpudetect.h" #include "../mangle.h" #include "../bswap.h" +#include "../libvo/fastmemcpy.h" #ifdef ARCH_X86 #define CAN_COMPILE_X86_ASM @@ -15,6 +15,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "sub_cc.h" diff --git a/subreader.c b/subreader.c index c3c2a912eb..540415e461 100644 --- a/subreader.c +++ b/subreader.c @@ -243,7 +243,7 @@ subtitle *sub_read_line_subviewer(FILE *fd,subtitle *current) { char *curptr=current->text[i]=(char *)malloc (len+1); if (!current->text[i]) return ERR; //strncpy (current->text[i], line, len); current->text[i][len]='\0'; - for(j; j<len; j++) { + for(; j<len; j++) { /* let's filter html tags ::atmos */ if(line[j]=='>') { skip=0; diff --git a/vidix/drivers/mga_vid.c b/vidix/drivers/mga_vid.c index 56c59204b1..d37bb58125 100644 --- a/vidix/drivers/mga_vid.c +++ b/vidix/drivers/mga_vid.c @@ -777,7 +777,7 @@ int vixConfigPlayback(vidix_playback_t *config) return(EFAULT); } mga_src_base &= (~0xFFFF); /* 64k boundary */ - if (mga_verbose > 1) printf("[mga] YUV buffer base: %p\n", mga_src_base); + if (mga_verbose > 1) printf("[mga] YUV buffer base: %#x\n", mga_src_base); config->dga_addr = mga_mem_base + mga_src_base; @@ -1325,7 +1325,7 @@ int vixInit(void) } } - if (mga_verbose > 1) printf("[mga] hardware addresses: mmio: %p, framebuffer: %p\n", + if (mga_verbose > 1) printf("[mga] hardware addresses: mmio: %#x, framebuffer: %#x\n", pci_info.base1, pci_info.base0); mga_mmio_base = map_phys_mem(pci_info.base1,0x4000); |