From 465f535c51f0b3c9050366fb4930c8a465a87f42 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 15:03:03 +0000 Subject: [PATCH 1/6] #include corresponding .h files in .c files. This ensures that function declarations in both files always match. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30596 b3059339-0415-0410-9bf9-f77b7e298cf2 --- av_opts.c | 1 + libmpcodecs/ae_lame.c | 1 + libmpdemux/mp3_hdr.c | 1 + mp_fifo.c | 2 +- osdep/getch2.c | 1 + osdep/mmap_anon.c | 2 ++ osdep/shmem.c | 1 + osdep/timer-linux.c | 1 + 8 files changed, 9 insertions(+), 1 deletion(-) diff --git a/av_opts.c b/av_opts.c index 2d708ebddc..d4285d5bb1 100644 --- a/av_opts.c +++ b/av_opts.c @@ -22,6 +22,7 @@ #include #include #include "libavcodec/opt.h" +#include "av_opts.h" int parse_avopts(void *v, char *str){ char *start; diff --git a/libmpcodecs/ae_lame.c b/libmpcodecs/ae_lame.c index db7fe3b32e..1d37d2f989 100644 --- a/libmpcodecs/ae_lame.c +++ b/libmpcodecs/ae_lame.c @@ -29,6 +29,7 @@ #include "stream/stream.h" #include "libmpdemux/muxer.h" #include "help_mp.h" +#include "ae_lame.h" #include "ae_pcm.h" #include "libaf/af_format.h" #include "libmpdemux/mp3_hdr.h" diff --git a/libmpdemux/mp3_hdr.c b/libmpdemux/mp3_hdr.c index 9c649d7e1b..0266469cb9 100644 --- a/libmpdemux/mp3_hdr.c +++ b/libmpdemux/mp3_hdr.c @@ -20,6 +20,7 @@ #include "config.h" #include "mp_msg.h" +#include "mp3_hdr.h" //----------------------- mp3 audio frame header parser ----------------------- diff --git a/mp_fifo.c b/mp_fifo.c index f56f79555b..2f7d888706 100644 --- a/mp_fifo.c +++ b/mp_fifo.c @@ -20,7 +20,7 @@ #include "osdep/timer.h" #include "input/input.h" #include "input/mouse.h" - +#include "mp_fifo.h" int key_fifo_size = 7; static int *key_fifo_data = NULL; diff --git a/osdep/getch2.c b/osdep/getch2.c index 4a591da2db..7145504e5d 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -58,6 +58,7 @@ #include "mp_fifo.h" #include "keycodes.h" +#include "getch2.h" #ifdef HAVE_TERMIOS static struct termios tio_orig; diff --git a/osdep/mmap_anon.c b/osdep/mmap_anon.c index 727761cb6c..d5b3a3dd2f 100644 --- a/osdep/mmap_anon.c +++ b/osdep/mmap_anon.c @@ -27,6 +27,8 @@ #include #include +#include "mmap_anon.h" + #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) #define MAP_ANONYMOUS MAP_ANON #endif diff --git a/osdep/shmem.c b/osdep/shmem.c index 9788d02bc5..e942f462ed 100644 --- a/osdep/shmem.c +++ b/osdep/shmem.c @@ -40,6 +40,7 @@ #include #include "mp_msg.h" +#include "shmem.h" #ifdef AIX #include diff --git a/osdep/timer-linux.c b/osdep/timer-linux.c index 8c1af557a0..0c1908899d 100644 --- a/osdep/timer-linux.c +++ b/osdep/timer-linux.c @@ -27,6 +27,7 @@ #include #include #include "config.h" +#include "timer.h" const char *timer_name = #ifdef HAVE_NANOSLEEP From a6207aaa68400ffcba36c7abc6a0cd31ed9428e7 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 16:16:42 +0000 Subject: [PATCH 2/6] libmpcodecs: Mark functions not used outside of their files as static. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30597 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_liba52.c | 6 ++++-- libmpcodecs/ad_realaud.c | 6 ++++-- libmpcodecs/vd_ffmpeg.c | 6 ++++-- libmpcodecs/vd_ijpg.c | 2 +- libmpcodecs/vd_realvid.c | 9 ++++++--- libmpcodecs/vd_xanim.c | 35 +++++++++++++++++------------------ libmpcodecs/vf_2xsai.c | 9 +++++---- 7 files changed, 41 insertions(+), 32 deletions(-) diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c index ab20576787..cac671718a 100644 --- a/libmpcodecs/ad_liba52.c +++ b/libmpcodecs/ad_liba52.c @@ -74,7 +74,8 @@ static const ad_info_t info = LIBAD_EXTERN(liba52) -int a52_fillbuff(sh_audio_t *sh_audio){ +static int a52_fillbuff(sh_audio_t *sh_audio) +{ int length=0; int flags=0; int sample_rate=0; @@ -138,7 +139,8 @@ int channels=0; return (flags&A52_LFE) ? (channels+1) : channels; } -sample_t dynrng_call (sample_t c, void *data) { +static sample_t dynrng_call (sample_t c, void *data) +{ // fprintf(stderr, "(%lf, %lf): %lf\n", (double)c, (double)a52_drc_level, (double)pow((double)c, a52_drc_level)); return pow((double)c, a52_drc_level); } diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c index 792a6a9e4b..c0fe074232 100644 --- a/libmpcodecs/ad_realaud.c +++ b/libmpcodecs/ad_realaud.c @@ -41,12 +41,14 @@ static const ad_info_t info = { LIBAD_EXTERN(realaud) -void *__builtin_new(unsigned long size) { +static void *__builtin_new(unsigned long size) +{ return malloc(size); } // required for cook's uninit: -void __builtin_delete(void* ize) { +static void __builtin_delete(void* ize) +{ free(ize); } diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 8c1e9ae9c3..29394317fe 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -172,7 +172,8 @@ static int control(sh_video_t *sh, int cmd, void *arg, ...){ return CONTROL_UNKNOWN; } -void mp_msp_av_log_callback(void *ptr, int level, const char *fmt, va_list vl) +static void mp_msp_av_log_callback(void *ptr, int level, const char *fmt, + va_list vl) { static int print_prefix=1; AVClass *avc= ptr ? *(AVClass **)ptr : NULL; @@ -766,7 +767,8 @@ typedef struct dp_hdr_s { uint32_t chunktab; // offset to chunk offset array } dp_hdr_t; -void swap_palette(void *pal) { +static void swap_palette(void *pal) +{ int i; uint32_t *p = pal; for (i = 0; i < AVPALETTE_COUNT; i++) diff --git a/libmpcodecs/vd_ijpg.c b/libmpcodecs/vd_ijpg.c index 42518e806b..81d681ad1f 100644 --- a/libmpcodecs/vd_ijpg.c +++ b/libmpcodecs/vd_ijpg.c @@ -110,7 +110,7 @@ METHODDEF(void) skip_input_data (j_decompress_ptr cinfo, long num_bytes) METHODDEF(void) term_source (j_decompress_ptr cinfo) { } -GLOBAL(void) jpeg_buf_src ( j_decompress_ptr cinfo, char * inbuf,int bufsize ) +static GLOBAL(void) jpeg_buf_src (j_decompress_ptr cinfo, char * inbuf, int bufsize) { my_src_ptr src; if (cinfo->src == NULL) cinfo->src=malloc( sizeof( my_source_mgr ) ); diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c index ee2f5f8407..3bbb44e636 100644 --- a/libmpcodecs/vd_realvid.c +++ b/libmpcodecs/vd_realvid.c @@ -84,15 +84,18 @@ static int bufsz = 0; static int dll_type = 0; /* 0 = unix dlopen, 1 = win32 dll */ #endif -void *__builtin_vec_new(unsigned long size) { +static void *__builtin_vec_new(unsigned long size) +{ return malloc(size); } -void __builtin_vec_delete(void *mem) { +static void __builtin_vec_delete(void *mem) +{ free(mem); } -void __pure_virtual(void) { +static void __pure_virtual(void) +{ printf("FATAL: __pure_virtual() called!\n"); // exit(1); } diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index a7f98add49..afa782afc8 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -335,7 +335,7 @@ static int xacodec_query(sh_video_t *sh, XA_CODEC_HDR *codec_hdr) } } -void XA_Print(char *fmt, ...) +static void XA_Print(char *fmt, ...) { va_list vallist; char buf[1024]; @@ -351,7 +351,7 @@ void XA_Print(char *fmt, ...) /* 0 is no debug (needed by 3ivX) */ long xa_debug = 0; -void TheEnd1(char *err_mess) +static void TheEnd1(char *err_mess) { XA_Print("error: %s - exiting\n", err_mess); /* we should exit here... */ @@ -359,7 +359,7 @@ void TheEnd1(char *err_mess) return; } -void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)()) +static void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)()) { // XA_Print("XA_Add_Func_To_Free_Chain('anim_hdr: %08x', 'function: %08x')", // anim_hdr, function); @@ -370,30 +370,29 @@ void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)()) return; } - -unsigned long XA_Time_Read(void) +static unsigned long XA_Time_Read(void) { return GetTimer(); //(GetRelativeTime()); } -void XA_dummy(void) +static void XA_dummy(void) { XA_Print("dummy() called"); } -void XA_Gen_YUV_Tabs(XA_ANIM_HDR *anim_hdr) +static void XA_Gen_YUV_Tabs(XA_ANIM_HDR *anim_hdr) { XA_Print("XA_Gen_YUV_Tabs('anim_hdr: %08x')", anim_hdr); return; } -void JPG_Setup_Samp_Limit_Table(XA_ANIM_HDR *anim_hdr) +static void JPG_Setup_Samp_Limit_Table(XA_ANIM_HDR *anim_hdr) { XA_Print("JPG_Setup_Samp_Limit_Table('anim_hdr: %08x')", anim_hdr); return; } -void JPG_Alloc_MCU_Bufs(XA_ANIM_HDR *anim_hdr, unsigned int width, +static void JPG_Alloc_MCU_Bufs(XA_ANIM_HDR *anim_hdr, unsigned int width, unsigned int height, unsigned int full_flag) { XA_Print("JPG_Alloc_MCU_Bufs('anim_hdr: %08x', 'width: %d', 'height: %d', 'full_flag: %d')", @@ -423,7 +422,7 @@ typedef struct image->planes[1][((x)>>1)+((y)>>1)*image->stride[1]]=cmap2x2->clr1_0;\ image->planes[2][((x)>>1)+((y)>>1)*image->stride[2]]=cmap2x2->clr1_1; -void XA_2x2_OUT_1BLK_Convert(unsigned char *image_p, unsigned int x, unsigned int y, +static void XA_2x2_OUT_1BLK_Convert(unsigned char *image_p, unsigned int x, unsigned int y, unsigned int imagex, XA_2x2_Color *cmap2x2) { mp_image_t *mpi = (mp_image_t *)image_p; @@ -440,7 +439,7 @@ void XA_2x2_OUT_1BLK_Convert(unsigned char *image_p, unsigned int x, unsigned in return; } -void XA_2x2_OUT_4BLKS_Convert(unsigned char *image_p, unsigned int x, unsigned int y, +static void XA_2x2_OUT_4BLKS_Convert(unsigned char *image_p, unsigned int x, unsigned int y, unsigned int imagex, XA_2x2_Color *cm0, XA_2x2_Color *cm1, XA_2x2_Color *cm2, XA_2x2_Color *cm3) { @@ -453,7 +452,7 @@ void XA_2x2_OUT_4BLKS_Convert(unsigned char *image_p, unsigned int x, unsigned i return; } -void *YUV2x2_Blk_Func(unsigned int image_type, int blks, unsigned int dith_flag) +static void *YUV2x2_Blk_Func(unsigned int image_type, int blks, unsigned int dith_flag) { mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "YUV2x2_Blk_Func(image_type=%d, blks=%d, dith_flag=%d)\n", image_type, blks, dith_flag); @@ -470,7 +469,7 @@ void *YUV2x2_Blk_Func(unsigned int image_type, int blks, unsigned int dith_flag) // Take Four Y's and UV and put them into a 2x2 Color structure. -void XA_YUV_2x2_clr(XA_2x2_Color *cmap2x2, unsigned int Y0, unsigned int Y1, +static void XA_YUV_2x2_clr(XA_2x2_Color *cmap2x2, unsigned int Y0, unsigned int Y1, unsigned int Y2, unsigned int Y3, unsigned int U, unsigned int V, unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) { @@ -487,7 +486,7 @@ void XA_YUV_2x2_clr(XA_2x2_Color *cmap2x2, unsigned int Y0, unsigned int Y1, return; } -void *YUV2x2_Map_Func(unsigned int image_type, unsigned int dith_type) +static void *YUV2x2_Map_Func(unsigned int image_type, unsigned int dith_type) { mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "YUV2x2_Map_Func('image_type: %d', 'dith_type: %d')", image_type, dith_type); @@ -522,7 +521,7 @@ YUVTabs def_yuv_tabs; /* -------------- YUV 4x4 1x1 1x1 (4:1:0 aka YVU9) [Indeo 3,4,5] ------------------ */ -void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, +static void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs, unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) { @@ -594,7 +593,7 @@ void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned in } } -void *XA_YUV1611_Func(unsigned int image_type) +static void *XA_YUV1611_Func(unsigned int image_type) { mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "XA_YUV1611_Func('image_type: %d')", image_type); return (void *)XA_YUV1611_Convert; @@ -602,7 +601,7 @@ void *XA_YUV1611_Func(unsigned int image_type) /* --------------- YUV 2x2 1x1 1x1 (4:2:0 aka YV12) [3ivX,H263] ------------ */ -void XA_YUV221111_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, +static void XA_YUV221111_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs, unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) { @@ -632,7 +631,7 @@ void XA_YUV221111_Convert(unsigned char *image_p, unsigned int imagex, unsigned mpi->stride[1]=mpi->stride[2]=uvstride; //=i_x/4; // yuv->uv_w } -void *XA_YUV221111_Func(unsigned int image_type) +static void *XA_YUV221111_Func(unsigned int image_type) { mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "XA_YUV221111_Func('image_type: %d')\n",image_type); return (void *)XA_YUV221111_Convert; diff --git a/libmpcodecs/vf_2xsai.c b/libmpcodecs/vf_2xsai.c index e28ada4818..83805b8794 100644 --- a/libmpcodecs/vf_2xsai.c +++ b/libmpcodecs/vf_2xsai.c @@ -43,7 +43,7 @@ static int PixelsPerMask = 2; #define makecol(r,g,b) (r+(g<<8)+(b<<16)) #define makecol_depth(d,r,g,b) (r+(g<<8)+(b<<16)) -int Init_2xSaI(int d) +static int Init_2xSaI(int d) { int minr = 0, ming = 0, minb = 0; @@ -95,9 +95,10 @@ int Init_2xSaI(int d) + ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask) -void Super2xSaI_ex(uint8_t *src, uint32_t src_pitch, - uint8_t *dst, uint32_t dst_pitch, - uint32_t width, uint32_t height, int sbpp) { +static void Super2xSaI_ex(uint8_t *src, uint32_t src_pitch, + uint8_t *dst, uint32_t dst_pitch, + uint32_t width, uint32_t height, int sbpp) +{ unsigned int x, y; uint32_t color[16]; From 6833ea6ab29a4789cc267d41fb72bd1b0341a77f Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 16:22:17 +0000 Subject: [PATCH 3/6] libvo: Mark functions not used outside of their files as static. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30598 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/spuenc.c | 4 ++-- libvo/sub.c | 6 ++++-- libvo/vo_aa.c | 2 +- libvo/vo_directfb2.c | 14 ++++++++------ libvo/vo_mpegpes.c | 7 +++++-- libvo/vo_s3fb.c | 20 ++++++++++++++------ libvo/vo_zr.c | 12 ++++++++---- libvo/x11_common.c | 2 +- 8 files changed, 43 insertions(+), 24 deletions(-) diff --git a/libvo/spuenc.c b/libvo/spuenc.c index 670a393bc2..6ba45a1b6c 100644 --- a/libvo/spuenc.c +++ b/libvo/spuenc.c @@ -231,7 +231,7 @@ pixbuf_encode_rle(int x, int y, int w, int h, char *inbuf, int stride,encodedat } -void +static void pixbuf_load_xpm( pixbuf* pb, char* xpm[] ) { int colors, chrs, l, n; char c[4], table[256]; @@ -271,7 +271,7 @@ pixbuf_load_xpm( pixbuf* pb, char* xpm[] ) { } } -void +static void pixbuf_delete( pixbuf* pb ) { free( pb->pixels ); } diff --git a/libvo/sub.c b/libvo/sub.c index d0abbf30cc..79780ce974 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -1090,8 +1090,10 @@ void free_osd_list(void){ #define FONT_LOAD_DEFER 6 -int vo_update_osd_ext(int dxs,int dys, int left_border, int top_border, - int right_border, int bottom_border, int orig_w, int orig_h){ +static int vo_update_osd_ext(int dxs,int dys, int left_border, int top_border, + int right_border, int bottom_border, int orig_w, + int orig_h) +{ mp_osd_obj_t* obj=vo_osd_list; int chg=0; #ifdef CONFIG_FREETYPE diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c index cefd88c819..9d5d180bec 100644 --- a/libvo/vo_aa.c +++ b/libvo/vo_aa.c @@ -96,7 +96,7 @@ static struct SwsContext *sws=NULL; int aaopt_osdcolor = AA_SPECIAL; int aaopt_subcolor = AA_SPECIAL; -void +static void resize(void){ /* * this function is called by aa lib if windows resizes diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c index d2e8a4a7fa..e69c7ae932 100644 --- a/libvo/vo_directfb2.c +++ b/libvo/vo_directfb2.c @@ -138,7 +138,8 @@ static int field_parity = -1; * implementation * ******************************/ -void unlock(void) { +static void unlock(void) +{ if (frame && framelocked) frame->Unlock(frame); if (primary && primarylocked) primary->Unlock(primary); } @@ -310,7 +311,7 @@ static int preinit(const char *arg) } -DFBSurfacePixelFormat convformat(uint32_t format) +static DFBSurfacePixelFormat convformat(uint32_t format) { // add more formats !!! switch (format) { @@ -350,9 +351,9 @@ unsigned int height; int setsize; } enum1_t; -DFBEnumerationResult test_format_callback( unsigned int id, - DFBDisplayLayerDescription desc, - void *data) +static DFBEnumerationResult test_format_callback(unsigned int id, + DFBDisplayLayerDescription desc, + void *data) { enum1_t *params =(enum1_t *)data; IDirectFBDisplayLayer *layer; @@ -448,7 +449,8 @@ int bpp; } videomode_t; -DFBEnumerationResult video_modes_callback( int width,int height,int bpp, void *data) +static DFBEnumerationResult video_modes_callback(int width, int height, + int bpp, void *data) { videomode_t *params =(videomode_t *)data; diff --git a/libvo/vo_mpegpes.c b/libvo/vo_mpegpes.c index 94fe08f6f2..4813916fbd 100644 --- a/libvo/vo_mpegpes.c +++ b/libvo/vo_mpegpes.c @@ -220,11 +220,14 @@ static int my_write(unsigned char* data,int len){ return orig_len; } -void send_pes_packet(unsigned char* data,int len,int id,int timestamp){ +static void send_pes_packet(unsigned char* data, int len, int id, int timestamp) +{ send_mpeg_pes_packet (data, len, id, timestamp, 1, my_write); } -void send_lpcm_packet(unsigned char* data,int len,int id,unsigned int timestamp,int freq_id){ +static void send_lpcm_packet(unsigned char* data, int len, int id, + unsigned int timestamp, int freq_id) +{ send_mpeg_lpcm_packet(data, len, id, timestamp, freq_id, my_write); } diff --git a/libvo/vo_s3fb.c b/libvo/vo_s3fb.c index c45b2c66e4..94863ed5de 100644 --- a/libvo/vo_s3fb.c +++ b/libvo/vo_s3fb.c @@ -105,18 +105,21 @@ static void clear_screen(void); #define OUTREG(mmreg, value) *(unsigned int *)(&v->mmio[mmreg]) = value -int readcrtc(int reg) { +static int readcrtc(int reg) +{ outb(reg, 0x3d4); return inb(0x3d5); } -void writecrtc(int reg, int value) { +static void writecrtc(int reg, int value) +{ outb(reg, 0x3d4); outb(value, 0x3d5); } // enable S3 registers -int enable(void) { +static int enable(void) +{ int fd; if (v) @@ -148,7 +151,8 @@ int enable(void) { return 0; } -void disable(void) { +static void disable(void) +{ if (v) { writecrtc(0x53, v->cr53); writecrtc(0x39, v->cr39); @@ -160,7 +164,10 @@ void disable(void) { } } -int yuv_on(int format, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int crop, int xres, int yres, int line_length, int offset) { +static int yuv_on(int format, int src_w, int src_h, int dst_x, int dst_y, + int dst_w, int dst_h, int crop, int xres, int yres, + int line_length, int offset) +{ int tmp, pitch, start, src_wc, src_hc, bpp; if (format == 0 || format == 7) @@ -227,7 +234,8 @@ int yuv_on(int format, int src_w, int src_h, int dst_x, int dst_y, int dst_w, in return offset; } -void yuv_off(void) { +static void yuv_off(void) +{ writecrtc(0x67, readcrtc(0x67) & ~0xc); memset(v->mmio + 0x8180, 0, 0x80); OUTREG(0x81b8, 0x900); diff --git a/libvo/vo_zr.c b/libvo/vo_zr.c index e8d1f23e11..95b12eb243 100644 --- a/libvo/vo_zr.c +++ b/libvo/vo_zr.c @@ -121,7 +121,8 @@ static zr_info_t zr_info[ZR_MAX_DEVICES] = { #define MJPEG_SIZE 1024*256 -int zoran_getcap(zr_info_t *zr) { +static int zoran_getcap(zr_info_t *zr) +{ char* dev = NULL; if (zr->device) @@ -196,7 +197,8 @@ int zoran_getcap(zr_info_t *zr) { return 0; } -int init_zoran(zr_info_t *zr, int stretchx, int stretchy) { +static int init_zoran(zr_info_t *zr, int stretchx, int stretchy) +{ /* center the image, and stretch it as far as possible (try to keep * aspect) and check if it fits */ if (zr->image_width > zr->vc.maxwidth) { @@ -264,7 +266,8 @@ int init_zoran(zr_info_t *zr, int stretchx, int stretchy) { return 0; } -void uninit_zoran(zr_info_t *zr) { +static void uninit_zoran(zr_info_t *zr) +{ if (zr->image) { free(zr->image); zr->image=NULL; @@ -283,7 +286,8 @@ void uninit_zoran(zr_info_t *zr) { close(zr->vdes); } -int zr_geometry_sane(geo_t *g, unsigned int width, unsigned int height) { +static int zr_geometry_sane(geo_t *g, unsigned int width, unsigned int height) +{ if (g->set) { if (g->width%2 != 0 || g->height%2 != 0 || g->xoff%2 != 0 || g->yoff%2 != 0) { diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 78e71c74b2..c0278caa42 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -2122,7 +2122,7 @@ void vo_xv_get_max_img_dim( uint32_t * width, uint32_t * height ) * Outputs the content of |ck_handling| as a readable message. * */ -void vo_xv_print_ck_info(void) +static void vo_xv_print_ck_info(void) { mp_msg( MSGT_VO, MSGL_V, "[xv common] " ); From 2c8f5fa622f0ff1a9186a26deada9b3e72603e49 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 16:32:38 +0000 Subject: [PATCH 4/6] stream: Mark functions not used outside of their files as static. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30599 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/cache2.c | 9 ++++++--- stream/network.c | 2 +- stream/stream.c | 7 ++++--- stream/stream_dvd.c | 9 ++++++--- stream/tv.c | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/stream/cache2.c b/stream/cache2.c index 1197df9df1..00415ad9fe 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -93,13 +93,15 @@ static int min_fill=0; int cache_fill_status=0; -void cache_stats(cache_vars_t* s){ +static void cache_stats(cache_vars_t *s) +{ int newb=s->max_filepos-s->read_filepos; // new bytes in the buffer mp_msg(MSGT_CACHE,MSGL_INFO,"0x%06X [0x%06X] 0x%06X ",(int)s->min_filepos,(int)s->read_filepos,(int)s->max_filepos); mp_msg(MSGT_CACHE,MSGL_INFO,"%3d %% (%3d%%)\n",100*newb/s->buffer_size,100*min_fill/s->buffer_size); } -int cache_read(cache_vars_t* s,unsigned char* buf,int size){ +static int cache_read(cache_vars_t *s, unsigned char *buf, int size) +{ int total=0; while(size>0){ int pos,newb,len; @@ -145,7 +147,8 @@ int cache_read(cache_vars_t* s,unsigned char* buf,int size){ return total; } -int cache_fill(cache_vars_t* s){ +static int cache_fill(cache_vars_t *s) +{ int back,back2,newb,space,len,pos; off_t read=s->read_filepos; diff --git a/stream/network.c b/stream/network.c index d6b8079276..f9caf16720 100644 --- a/stream/network.c +++ b/stream/network.c @@ -464,7 +464,7 @@ void fixup_network_stream_cache(stream_t *stream) { } -int +static int streaming_stop( stream_t *stream ) { stream->streaming_ctrl->status = streaming_stopped_e; return 0; diff --git a/stream/stream.c b/stream/stream.c index 87b2e02a29..203e2ed291 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -140,9 +140,10 @@ static const stream_info_t* const auto_open_streams[] = { NULL }; -stream_t* open_stream_plugin(const stream_info_t* sinfo,char* filename,int mode, - char** options, int* file_format, int* ret, - char** redirected_url) { +static stream_t* open_stream_plugin(const stream_info_t* sinfo, char* filename, + int mode, char** options, int* file_format, + int* ret, char** redirected_url) +{ void* arg = NULL; stream_t* s; m_struct_t* desc = (m_struct_t*)sinfo->opts; diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 3747bbaac1..1fee28ad6c 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -249,7 +249,8 @@ static int dvd_next_cell(dvd_priv_t *d) { return next_cell; } -int dvd_read_sector(dvd_priv_t *d,unsigned char* data) { +static int dvd_read_sector(dvd_priv_t *d, unsigned char *data) +{ int len; if(d->packs_left==0) { @@ -369,7 +370,8 @@ read_next: return d->cur_pack-1; } -void dvd_seek(dvd_priv_t *d,int pos) { +static void dvd_seek(dvd_priv_t *d, int pos) +{ d->packs_left=-1; d->cur_pack=pos; @@ -407,7 +409,8 @@ void dvd_seek(dvd_priv_t *d,int pos) { d->angle_seek=1; } -void dvd_close(dvd_priv_t *d) { +static void dvd_close(dvd_priv_t *d) +{ ifoClose(d->vts_file); ifoClose(d->vmg_file); DVDCloseFile(d->title); diff --git a/stream/tv.c b/stream/tv.c index 6c05ac2eb5..e98730f2b6 100644 --- a/stream/tv.c +++ b/stream/tv.c @@ -354,7 +354,7 @@ int tv_set_norm(tvi_handle_t *tvh, char* norm) return 1; } -int tv_set_norm_i(tvi_handle_t *tvh, int norm) +static int tv_set_norm_i(tvi_handle_t *tvh, int norm) { tvh->norm = norm; From ff8c0443186d870b70b6729d47ab548894b13f3c Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 16 Feb 2010 19:07:06 +0000 Subject: [PATCH 5/6] Fix win32 gui compilation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30600 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/win32/gui.c | 1 + gui/win32/gui.h | 1 - gui/win32/interface.c | 9 +++++---- gui/win32/preferences.c | 1 + gui/win32/wincfg.c | 1 + 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gui/win32/gui.c b/gui/win32/gui.c index d9d86f58a3..66940bc209 100644 --- a/gui/win32/gui.c +++ b/gui/win32/gui.c @@ -40,6 +40,7 @@ #include "stream/stream.h" #include "libvo/video_out.h" #include "gui/interface.h" +#include "gui/mplayer/gmplayer.h" #include "gui.h" #include "dialogs.h" diff --git a/gui/win32/gui.h b/gui/win32/gui.h index d8578dc96f..72e90f2538 100644 --- a/gui/win32/gui.h +++ b/gui/win32/gui.h @@ -105,7 +105,6 @@ int create_window(gui_t *gui, char *skindir); int create_subwindow(gui_t *gui, char *skindir); int parse_filename(char *file, play_tree_t *playtree, m_config_t *mconfig, int clear); void capitalize(char *filename); -int import_playtree_playlist_into_gui(play_tree_t *my_playtree, m_config_t *config); /* Dialogs */ void display_playlistwindow(gui_t *gui); diff --git a/gui/win32/interface.c b/gui/win32/interface.c index 209a1889d4..d74c76a356 100644 --- a/gui/win32/interface.c +++ b/gui/win32/interface.c @@ -39,14 +39,15 @@ #include "libvo/video_out.h" #include "libao2/audio_out.h" #include "access_mpcontext.h" +#include "libmpcodecs/vd.h" +#include "gui/mplayer/gmplayer.h" +#include "mp_core.h" #include "gui.h" #include "dialogs.h" #ifdef CONFIG_LIBCDIO #include #endif -extern int abs_seek_pos; -extern float rel_seek_secs; extern int vcd_track; extern af_cfg_t af_cfg; int guiWinID = 0; @@ -466,7 +467,7 @@ static unsigned __stdcall GuiThread(void* param) if(!skinName) skinName = strdup("Blue"); if(!mygui) mygui = create_gui(get_path("skins"), skinName, guiSetEvent); - if(!mygui) exit_player("Unable to load GUI."); + if(!mygui) exit_player(EXIT_ERROR); if(autosync && autosync != gtkAutoSync) { @@ -683,7 +684,7 @@ int guiGetEvent(int type, char *arg) mygui->uninit(mygui); free(mygui); mygui = NULL; - exit_player("Done"); + exit_player(EXIT_QUIT); return 0; } case MP_CMD_GUI_STOP: diff --git a/gui/win32/preferences.c b/gui/win32/preferences.c index 2a98b2d807..868c687208 100644 --- a/gui/win32/preferences.c +++ b/gui/win32/preferences.c @@ -30,6 +30,7 @@ #include "libvo/video_out.h" #include "libao2/audio_out.h" #include "mixer.h" +#include "gui/mplayer/gmplayer.h" #include "gui/interface.h" #include "gui.h" #include "mp_msg.h" diff --git a/gui/win32/wincfg.c b/gui/win32/wincfg.c index 245bbc0be2..33d5ae9fd6 100644 --- a/gui/win32/wincfg.c +++ b/gui/win32/wincfg.c @@ -32,6 +32,7 @@ #include "m_option.h" #include "libvo/video_out.h" #include "mixer.h" +#include "gui/mplayer/gmplayer.h" #include "gui/interface.h" #include "gui.h" From 091e2a43133f174c99af9596d10d9d11bc06cf03 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 16 Feb 2010 19:34:41 +0000 Subject: [PATCH 6/6] Remove unused XPM-loading function pixbuf_load_xpm() from spuenc.c. Remove unused function pixbuf_delete() from spuenc.[ch]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30601 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/spuenc.c | 47 ----------------------------------------------- libvo/spuenc.h | 1 - 2 files changed, 48 deletions(-) diff --git a/libvo/spuenc.c b/libvo/spuenc.c index 6ba45a1b6c..bc35a06d18 100644 --- a/libvo/spuenc.c +++ b/libvo/spuenc.c @@ -229,50 +229,3 @@ pixbuf_encode_rle(int x, int y, int w, int h, char *inbuf, int stride,encodedat } encode_do_control(x,y, ed, &pb); } - - -static void -pixbuf_load_xpm( pixbuf* pb, char* xpm[] ) { - int colors, chrs, l, n; - char c[4], table[256]; - unsigned char *b, *i; - - sscanf( xpm[0], "%d %d %d %d", &pb->x, &pb->y, &colors, &chrs); - if( colors > 4 ) { - fprintf( stderr, "the pixmap MUST be 4 colors or less\n"); - exit (-1); - } - if( chrs != 1 ) { - fprintf( stderr, "the XPM format MUST be 1 char per pixel\n"); - exit (-1); - } - if( pb->x > 0xFFF || pb->y > 0xFFF ) { - fprintf( stderr, "the size is excesive\n"); - exit (-1); - } - - for( l=0; lrgb[l]); - if( n < 2 ) { - /* this one is transparent */ - pb->rgb[l]=0xff000000; - } - table[(int)c[l]]=l; - } - - pb->pixels= malloc( pb->x * pb->y ); - b= pb->pixels; - - for( l= colors+1; l <= pb->y + colors; l++ ) { - i= xpm[l]; - while( (int)*i) { - *b++ = table[*i++]; - } - } -} - -static void -pixbuf_delete( pixbuf* pb ) { - free( pb->pixels ); -} - diff --git a/libvo/spuenc.h b/libvo/spuenc.h index 5bc83b329b..7f4590b4ac 100644 --- a/libvo/spuenc.h +++ b/libvo/spuenc.h @@ -41,6 +41,5 @@ typedef struct { } encodedata; void pixbuf_encode_rle(int x, int y, int w, int h, char *inbuf, int stride, encodedata *ed); -void pixbuf_delete(pixbuf* pb); #endif /* MPLAYER_SPUENC_H */