From 552206882168b6ef4bacd1c3b198df21a0ce6ccf Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 14:48:54 +0000 Subject: [PATCH 01/16] Simplify. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30580 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_avi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmpdemux/demux_avi.c b/libmpdemux/demux_avi.c index 2024f8aa62..4dc4662c05 100644 --- a/libmpdemux/demux_avi.c +++ b/libmpdemux/demux_avi.c @@ -533,14 +533,15 @@ static demuxer_t* demux_open_avi(demuxer_t* demuxer){ // calculating audio/video bitrate: if(priv->idx_size>0){ // we have index, let's count 'em! + AVIINDEXENTRY *idx = priv->idx; int64_t vsize=0; int64_t asize=0; size_t vsamples=0; size_t asamples=0; int i; for(i=0;iidx_size;i++){ - int id=avi_stream_id(((AVIINDEXENTRY *)priv->idx)[i].ckid); - int len=((AVIINDEXENTRY *)priv->idx)[i].dwChunkLength; + int id=avi_stream_id(idx[i].ckid); + int len=idx[i].dwChunkLength; if(sh_video->ds->id == id) { vsize+=len; ++vsamples; From 4b6ce33628fd942a18bc5e5053da61024c13a9c6 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Feb 2010 14:49:44 +0000 Subject: [PATCH 02/16] Directly mark structs as WINE_PACKED where all members are marked as packed. This fixes a ton of gcc warnings about ignored packed attributes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30581 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/wine/mmreg.h | 26 +++++++++++++------------- loader/wine/pe_image.h | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/loader/wine/mmreg.h b/loader/wine/mmreg.h index 4ab6b7a2ff..2ed01a215e 100644 --- a/loader/wine/mmreg.h +++ b/loader/wine/mmreg.h @@ -89,19 +89,19 @@ typedef struct { #ifndef _MPEGLAYER3WAVEFORMAT_ #define _MPEGLAYER3WAVEFORMAT_ -typedef struct mpeglayer3waveformat_tag { - WORD wFormatTag WINE_PACKED; - WORD nChannels WINE_PACKED; - DWORD nSamplesPerSec WINE_PACKED; - DWORD nAvgBytesPerSec WINE_PACKED; - WORD nBlockAlign WINE_PACKED; - WORD wBitsPerSample WINE_PACKED; - WORD cbSize WINE_PACKED; - WORD wID WINE_PACKED; - DWORD fdwFlags WINE_PACKED; - WORD nBlockSize WINE_PACKED; - WORD nFramesPerBlock WINE_PACKED; - WORD nCodecDelay WINE_PACKED; +typedef struct WINE_PACKED mpeglayer3waveformat_tag { + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + WORD wBitsPerSample; + WORD cbSize; + WORD wID; + DWORD fdwFlags; + WORD nBlockSize; + WORD nFramesPerBlock; + WORD nCodecDelay; } MPEGLAYER3WAVEFORMAT; #endif /* !_MPEGLAYER3WAVEFORMAT_ */ diff --git a/loader/wine/pe_image.h b/loader/wine/pe_image.h index 1c28bc12d0..aab6fd8cd3 100644 --- a/loader/wine/pe_image.h +++ b/loader/wine/pe_image.h @@ -54,19 +54,19 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY, LPCWSTR, DW typedef DWORD CALLBACK (*DLLENTRYPROC)(HMODULE,DWORD,LPVOID); -typedef struct { - WORD popl WINE_PACKED; /* 0x8f 0x05 */ - DWORD addr_popped WINE_PACKED;/* ... */ - BYTE pushl1 WINE_PACKED; /* 0x68 */ - DWORD newret WINE_PACKED; /* ... */ - BYTE pushl2 WINE_PACKED; /* 0x68 */ - DWORD origfun WINE_PACKED; /* original function */ - BYTE ret1 WINE_PACKED; /* 0xc3 */ - WORD addesp WINE_PACKED; /* 0x83 0xc4 */ - BYTE nrofargs WINE_PACKED; /* nr of arguments to add esp, */ - BYTE pushl3 WINE_PACKED; /* 0x68 */ - DWORD oldret WINE_PACKED; /* Filled out from popl above */ - BYTE ret2 WINE_PACKED; /* 0xc3 */ +typedef struct WINE_PACKED { + WORD popl; /* 0x8f 0x05 */ + DWORD addr_popped; /* ... */ + BYTE pushl1; /* 0x68 */ + DWORD newret; /* ... */ + BYTE pushl2; /* 0x68 */ + DWORD origfun; /* original function */ + BYTE ret1; /* 0xc3 */ + WORD addesp; /* 0x83 0xc4 */ + BYTE nrofargs; /* nr of arguments to add esp, */ + BYTE pushl3; /* 0x68 */ + DWORD oldret; /* Filled out from popl above */ + BYTE ret2; /* 0xc3 */ } ELF_STDCALL_STUB; typedef struct { From 782c37899b9abf1cea45e8f8e3d65163378c5cd1 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Feb 2010 14:54:48 +0000 Subject: [PATCH 03/16] Declare vf_menu_pause_update in libmenu/menu.h. This avoids a forward declaration in mplayer.c. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30582 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmenu/menu.h | 3 +++ mplayer.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libmenu/menu.h b/libmenu/menu.h index d29091a4ae..a22dc12abf 100644 --- a/libmenu/menu.h +++ b/libmenu/menu.h @@ -21,6 +21,7 @@ #include "m_struct.h" #include "libmpcodecs/mp_image.h" +#include "libmpcodecs/vf.h" struct menu_priv_s; typedef struct menu_s menu_t; @@ -113,4 +114,6 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt, void menu_draw_box(mp_image_t* mpi, unsigned char grey, unsigned char alpha, int x, int y, int w, int h); +void vf_menu_pause_update(struct vf_instance_s* vf); + #endif /* MPLAYER_MENU_H */ diff --git a/mplayer.c b/mplayer.c index e2d9bd6f9b..566f955220 100644 --- a/mplayer.c +++ b/mplayer.c @@ -334,7 +334,6 @@ char* current_module=NULL; // for debugging #ifdef CONFIG_MENU #include "m_struct.h" #include "libmenu/menu.h" -void vf_menu_pause_update(struct vf_instance_s* vf); extern vf_info_t vf_info_menu; static vf_info_t* libmenu_vfs[] = { &vf_info_menu, From b2b8d0e1f2a32b6e7d62038be36d7a61ea92f3c1 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 15:09:21 +0000 Subject: [PATCH 04/16] Simplify and slightly speed up avi_stream_id function. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30583 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demuxer.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index a9fc58dea8..28c4c951f1 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -389,13 +389,9 @@ void ds_clear_parser(demux_stream_t *sh); stream_t* new_ds_stream(demux_stream_t *ds); static inline int avi_stream_id(unsigned int id){ - unsigned char *p=(unsigned char *)&id; unsigned char a,b; -#if HAVE_BIGENDIAN - a=p[3]-'0'; b=p[2]-'0'; -#else - a=p[0]-'0'; b=p[1]-'0'; -#endif + a = id - '0'; + b = (id >> 8) - '0'; if(a>9 || b>9) return 100; // invalid ID return a*10+b; } From c2c64b459fd7beba97569ab7849f90cbe8e5243e Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 15:17:24 +0000 Subject: [PATCH 05/16] Make len unsigned. More correct anyway and avoids sign extension to 64 bit for the 64+32 bit addition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30584 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_avi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpdemux/demux_avi.c b/libmpdemux/demux_avi.c index 4dc4662c05..51a33ca6ae 100644 --- a/libmpdemux/demux_avi.c +++ b/libmpdemux/demux_avi.c @@ -541,7 +541,7 @@ static demuxer_t* demux_open_avi(demuxer_t* demuxer){ int i; for(i=0;iidx_size;i++){ int id=avi_stream_id(idx[i].ckid); - int len=idx[i].dwChunkLength; + unsigned len=idx[i].dwChunkLength; if(sh_video->ds->id == id) { vsize+=len; ++vsamples; From f452c1262fd167a90fd63e13bd2de7bf8c7ca17b Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 15:39:52 +0000 Subject: [PATCH 06/16] Add support for decoding 4:2:2 and 4:4:4 Theora files. Patch by Giorgio Vazzana [mywing81 gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30585 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 2 +- libmpcodecs/vd_theora.c | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index bbdc753be4..26a052911e 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -584,7 +584,7 @@ videocodec theora fourcc theo,Thra driver theora dll libtheora - out YV12 + out YV12,422P,444P ; prefer native codecs over win32? ; the win32 codecs probably are (better) optimized and support direct diff --git a/libmpcodecs/vd_theora.c b/libmpcodecs/vd_theora.c index 35e3edfab8..b8be6d747b 100644 --- a/libmpcodecs/vd_theora.c +++ b/libmpcodecs/vd_theora.c @@ -41,11 +41,28 @@ LIBVD_EXTERN(theora) #define THEORA_NUM_HEADER_PACKETS 3 +typedef struct theora_struct_st { + theora_state st; + theora_comment cc; + theora_info inf; +} theora_struct_t; + +/** Convert Theora pixelformat to the corresponding IMGFMT_ */ +static uint32_t theora_pixelformat2imgfmt(theora_pixelformat fmt){ + switch(fmt) { + case OC_PF_420: return IMGFMT_YV12; + case OC_PF_422: return IMGFMT_422P; + case OC_PF_444: return IMGFMT_444P; + } + return 0; +} + // to set/get/query special features/parameters static int control(sh_video_t *sh,int cmd,void* arg,...){ + theora_struct_t *context = sh->context; switch(cmd) { case VDCTRL_QUERY_FORMAT: - if (*(int*)arg == IMGFMT_YV12) + if (*(int*)arg == theora_pixelformat2imgfmt(context->inf.pixelformat)) return CONTROL_TRUE; return CONTROL_FALSE; } @@ -53,12 +70,6 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ return CONTROL_UNKNOWN; } -typedef struct theora_struct_st { - theora_state st; - theora_comment cc; - theora_info inf; -} theora_struct_t; - /* * init driver */ @@ -104,7 +115,7 @@ static int init(sh_video_t *sh){ mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Theora video init ok!\n"); - return mpcodecs_config_vo (sh,context->inf.frame_width,context->inf.frame_height,IMGFMT_YV12); + return mpcodecs_config_vo (sh,context->inf.frame_width,context->inf.frame_height,theora_pixelformat2imgfmt(context->inf.pixelformat)); err_out: free(context); From af356b5d1573632226853260c6d725e54ac5be44 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 18:30:32 +0000 Subject: [PATCH 07/16] Use calloc instead of malloc+memset git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30586 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load_ft.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 2b4caad215..97bfa7d960 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -838,9 +838,8 @@ static font_desc_t* init_font_desc(void) font_desc_t *desc; int i; - desc = malloc(sizeof(font_desc_t)); + desc = calloc(1, sizeof(*desc)); if(!desc) return NULL; - memset(desc,0,sizeof(font_desc_t)); desc->dynamic = 1; From 687744dfedd8c32db48ec24c1edc72d620b4580a Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 18:32:31 +0000 Subject: [PATCH 08/16] Remove pointless explicit member initialization to 0 when the struct is already zeroed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30587 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load_ft.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 97bfa7d960..886a7d6945 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -844,27 +844,10 @@ static font_desc_t* init_font_desc(void) desc->dynamic = 1; /* setup sane defaults */ - desc->name = NULL; - desc->fpath = NULL; - - desc->face_cnt = 0; - desc->charspace = 0; - desc->spacewidth = 0; - desc->height = 0; - desc->max_width = 0; - desc->max_height = 0; desc->freetype = 1; - desc->tables.g = NULL; - desc->tables.gt2 = NULL; - desc->tables.om = NULL; - desc->tables.omt = NULL; - desc->tables.tmp = NULL; - for(i = 0; i < 65536; i++) desc->start[i] = desc->width[i] = desc->font[i] = -1; - for(i = 0; i < 16; i++) - desc->pic_a[i] = desc->pic_b[i] = NULL; return desc; } From 51cc80d2dd160a075b49e61b8056c1dde5e7f55f Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 18:38:02 +0000 Subject: [PATCH 09/16] Use memset to initialize huge arrays. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30588 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load_ft.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 886a7d6945..d47033e11b 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -846,8 +846,9 @@ static font_desc_t* init_font_desc(void) /* setup sane defaults */ desc->freetype = 1; - for(i = 0; i < 65536; i++) - desc->start[i] = desc->width[i] = desc->font[i] = -1; + memset(desc->start, 0xff, sizeof(desc->start)); + memset(desc->width, 0xff, sizeof(desc->width)); + memset(desc->font, 0xff, sizeof(desc->font)); return desc; } From 676a0c121e2617db4ef3e5601ec755f6333e3e24 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 14 Feb 2010 18:50:32 +0000 Subject: [PATCH 10/16] Remove unused variable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30589 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load_ft.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index d47033e11b..b27bcac2bf 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -836,7 +836,6 @@ static int prepare_charset_unicode(FT_Face face, FT_ULong *charset, FT_ULong *ch static font_desc_t* init_font_desc(void) { font_desc_t *desc; - int i; desc = calloc(1, sizeof(*desc)); if(!desc) return NULL; From cf3100872d75d41c21ef8b3fe5fe98eb307e3b19 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 11:31:29 +0000 Subject: [PATCH 11/16] Remove pointless header #includes; #include only required header stdint.h. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30590 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/aac_hdr.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libmpdemux/aac_hdr.c b/libmpdemux/aac_hdr.c index e9c4f5dcc7..1866288349 100644 --- a/libmpdemux/aac_hdr.c +++ b/libmpdemux/aac_hdr.c @@ -18,10 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include -#include - -#include "config.h" +#include /// \param srate (out) sample rate /// \param num (out) number of audio frames in this ADTS frame From cc7fdaf5c5022e6325ae62b01e4019664480e404 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 13:04:00 +0000 Subject: [PATCH 12/16] VIDIX: Mark some functions not used outside their files as static. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30591 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/nvidia_vid.c | 6 ++++-- vidix/vidix.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vidix/nvidia_vid.c b/vidix/nvidia_vid.c index 227fbcf6ef..f969b15aee 100644 --- a/vidix/nvidia_vid.c +++ b/vidix/nvidia_vid.c @@ -441,12 +441,14 @@ struct rivatv_info { }; typedef struct rivatv_info rivatv_info; -uint8_t nvReadVGA (struct rivatv_chip *chip, int index) { +static uint8_t nvReadVGA(struct rivatv_chip *chip, int index) +{ VID_WR08 (chip->PCIO, 0x3D4, index); return VID_RD08 (chip->PCIO, 0x3D5); } -void nvWriteVGA (struct rivatv_chip *chip, int index, int data) { +static void nvWriteVGA(struct rivatv_chip *chip, int index, int data) +{ VID_WR08 (chip->PCIO, 0x3D4, index); VID_WR08 (chip->PCIO, 0x3D5, data); } diff --git a/vidix/vidix.c b/vidix/vidix.c index adb5613948..8fe02e4836 100644 --- a/vidix/vidix.c +++ b/vidix/vidix.c @@ -153,7 +153,7 @@ int vdlPlaybackSetEq (VDXContext *ctx, const vidix_video_eq_t *e) return ctx->drv->set_eq ? ctx->drv->set_eq (e) : ENOSYS; } -int vdlPlaybackCopyFrame (VDXContext *ctx, const vidix_dma_t *f) +static int vdlPlaybackCopyFrame(VDXContext *ctx, const vidix_dma_t *f) { return ctx->drv->copy_frame ? ctx->drv->copy_frame (f) : ENOSYS; } From aae2efd679e3001b5c52ea6e36703d7bd4cf02f1 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 13:07:00 +0000 Subject: [PATCH 13/16] VIDIX: #include drivers.h in drivers.c. This ensures that function declarations in both files always match. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30592 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/drivers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vidix/drivers.c b/vidix/drivers.c index 428b2d7ca4..cc10c9bf58 100644 --- a/vidix/drivers.c +++ b/vidix/drivers.c @@ -26,6 +26,7 @@ #include "config.h" #include "vidix.h" +#include "drivers.h" #include "libavutil/common.h" #include "mpbswap.h" #include "config.h" From a450db36fdd7850f21f71121f49c6016a75b12ee Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 13:10:24 +0000 Subject: [PATCH 14/16] Add header file for sis_init_video_bridge() instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30593 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/sis_bridge.c | 1 + vidix/sis_bridge.h | 26 ++++++++++++++++++++++++++ vidix/sis_vid.c | 4 +--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 vidix/sis_bridge.h diff --git a/vidix/sis_bridge.c b/vidix/sis_bridge.c index f143754a9a..265bce5fd3 100644 --- a/vidix/sis_bridge.c +++ b/vidix/sis_bridge.c @@ -28,6 +28,7 @@ #include #include "dha.h" +#include "sis_bridge.h" #include "sis_regs.h" #include "sis_defs.h" diff --git a/vidix/sis_bridge.h b/vidix/sis_bridge.h new file mode 100644 index 0000000000..d06488fad8 --- /dev/null +++ b/vidix/sis_bridge.h @@ -0,0 +1,26 @@ +/* + * VIDIX - VIDeo Interface for *niX. + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_SIS_BRIDGE_H +#define MPLAYER_SIS_BRIDGE_H + +void sis_init_video_bridge(void); + +#endif /* MPLAYER_SIS_BRIDGE_H */ diff --git a/vidix/sis_vid.c b/vidix/sis_vid.c index 0f5960cf54..4d82755bdf 100644 --- a/vidix/sis_vid.c +++ b/vidix/sis_vid.c @@ -37,6 +37,7 @@ #include "pci_ids.h" #include "pci_names.h" +#include "sis_bridge.h" #include "sis_regs.h" #include "sis_defs.h" @@ -167,9 +168,6 @@ static unsigned short sis_card_ids[] = { /** function declarations **/ -void sis_init_video_bridge(void); - - static void set_overlay(SISOverlayPtr pOverlay, int index); static void close_overlay(void); static void calc_scale_factor(SISOverlayPtr pOverlay, From caa956090a2d7b62790217b08c0a8dd108c71aef Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 13:16:17 +0000 Subject: [PATCH 15/16] Add header file for mplayer_audio_read() instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30594 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_mp3lib.c | 1 + libmpcodecs/ad_mp3lib.h | 24 ++++++++++++++++++++++++ mp3lib/sr1.c | 4 +--- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 libmpcodecs/ad_mp3lib.h diff --git a/libmpcodecs/ad_mp3lib.c b/libmpcodecs/ad_mp3lib.c index 5b50557c96..f262757526 100644 --- a/libmpcodecs/ad_mp3lib.c +++ b/libmpcodecs/ad_mp3lib.c @@ -23,6 +23,7 @@ #include "config.h" #include "ad_internal.h" +#include "ad_mp3lib.h" static const ad_info_t info = { diff --git a/libmpcodecs/ad_mp3lib.h b/libmpcodecs/ad_mp3lib.h new file mode 100644 index 0000000000..aeb78b4ed8 --- /dev/null +++ b/libmpcodecs/ad_mp3lib.h @@ -0,0 +1,24 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_AD_MP3LIB_H +#define MPLAYER_AD_MP3LIB_H + +int mplayer_audio_read(char *buf, int size); + +#endif /* MPLAYER_AD_MP3LIB_H */ diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c index 77ba630453..ee9e336877 100644 --- a/mp3lib/sr1.c +++ b/mp3lib/sr1.c @@ -20,7 +20,7 @@ #include "cpudetect.h" //#include "liba52/mm_accel.h" #include "mp_msg.h" - +#include "libmpcodecs/ad_mp3lib.h" #include "libvo/fastmemcpy.h" #include "libavutil/common.h" @@ -55,8 +55,6 @@ static long outscale = 32768; #include "tabinit.c" #if 1 -int mplayer_audio_read(char *buf,int size); - LOCAL int mp3_read(char *buf,int size){ // int len=fread(buf,1,size,mp3_file); int len=mplayer_audio_read(buf,size); From 3c514ea708749679623ae04fc8f7ade87e51aade Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 16 Feb 2010 14:52:59 +0000 Subject: [PATCH 16/16] Add header for init_global_rawdv_decoder() instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30595 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_libdv.c | 4 +--- libmpcodecs/vd_libdv.c | 1 + libmpcodecs/vd_libdv.h | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 libmpcodecs/vd_libdv.h diff --git a/libmpcodecs/ad_libdv.c b/libmpcodecs/ad_libdv.c index e7d0a82a54..8485a8883f 100644 --- a/libmpcodecs/ad_libdv.c +++ b/libmpcodecs/ad_libdv.c @@ -37,6 +37,7 @@ #include "libmpdemux/stheader.h" #include "ad_internal.h" +#include "vd_libdv.h" static const ad_info_t info = { @@ -49,9 +50,6 @@ static const ad_info_t info = LIBAD_EXTERN(libdv) -// defined in vd_libdv.c: -dv_decoder_t* init_global_rawdv_decoder(void); - static int preinit(sh_audio_t *sh_audio) { sh_audio->audio_out_minsize=4*DV_AUDIO_MAX_SAMPLES*2; diff --git a/libmpcodecs/vd_libdv.c b/libmpcodecs/vd_libdv.c index 02d7e2fc54..137fa7bf60 100644 --- a/libmpcodecs/vd_libdv.c +++ b/libmpcodecs/vd_libdv.c @@ -35,6 +35,7 @@ #include "libmpdemux/stheader.h" #include "vd_internal.h" +#include "vd_libdv.h" static const vd_info_t info = { diff --git a/libmpcodecs/vd_libdv.h b/libmpcodecs/vd_libdv.h new file mode 100644 index 0000000000..608d06bf21 --- /dev/null +++ b/libmpcodecs/vd_libdv.h @@ -0,0 +1,26 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_VD_LIBDV_H +#define MPLAYER_VD_LIBDV_H + +#include + +dv_decoder_t* init_global_rawdv_decoder(void); + +#endif /* MPLAYER_VD_LIBDV_H */