From 2f19fe91ec33bd4b480609dd7040e6255e986df9 Mon Sep 17 00:00:00 2001 From: tack Date: Mon, 22 Feb 2010 14:24:53 +0000 Subject: Output WAVE_FORMAT_EXTENSIBLE extension in wave header when waveheader option is enabled (default) and channels > 2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30708 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_pcm.c | 112 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 44 deletions(-) diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index bfcd8eb79f..10ee82a0e2 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -61,30 +61,75 @@ static int fast = 0; #define WAV_ID_DATA 0x61746164 /* "data" */ #define WAV_ID_PCM 0x0001 #define WAV_ID_FLOAT_PCM 0x0003 - -struct WaveHeader -{ - uint32_t riff; - uint32_t file_length; - uint32_t wave; - uint32_t fmt; - uint32_t fmt_length; - uint16_t fmt_tag; - uint16_t channels; - uint32_t sample_rate; - uint32_t bytes_per_second; - uint16_t block_align; - uint16_t bits; - uint32_t data; - uint32_t data_length; -}; +#define WAV_ID_FORMAT_EXTENSIBLE 0xfffe /* init with default values */ -static struct WaveHeader wavhdr; static uint64_t data_length; - static FILE *fp = NULL; + +static void fput16le(uint16_t val, FILE *fp) { + uint8_t bytes[2] = {val, val >> 8}; + fwrite(bytes, 1, 2, fp); +} + +static void fput32le(uint32_t val, FILE *fp) { + uint8_t bytes[4] = {val, val >> 8, val >> 16, val >> 24}; + fwrite(bytes, 1, 4, fp); +} + +static void write_wave_header(FILE *fp, uint64_t data_length) { + int use_waveex = (ao_data.channels >= 5 && ao_data.channels <= 8); + uint16_t fmt = (ao_data.format == AF_FORMAT_FLOAT_LE) ? WAV_ID_FLOAT_PCM : WAV_ID_PCM; + uint32_t fmt_chunk_size = use_waveex ? 40 : 16; + int bits = af_fmt2bits(ao_data.format); + + // Master RIFF chunk + fput32le(WAV_ID_RIFF, fp); + // RIFF chunk size: 'WAVE' + 'fmt ' + 4 + fmt_chunk_size + data chunk hdr (8) + data length + fput32le(12 + fmt_chunk_size + 8 + data_length, fp); + fput32le(WAV_ID_WAVE, fp); + + // Format chunk + fput32le(WAV_ID_FMT, fp); + fput32le(fmt_chunk_size, fp); + fput16le(use_waveex ? WAV_ID_FORMAT_EXTENSIBLE : fmt, fp); + fput16le(ao_data.channels, fp); + fput32le(ao_data.samplerate, fp); + fput32le(ao_data.bps, fp); + fput16le(ao_data.channels * (bits / 8), fp); + fput16le(bits, fp); + + if (use_waveex) { + // Extension chunk + fput16le(22, fp); + fput16le(bits, fp); + switch (ao_data.channels) { + case 5: + fput32le(0x0607, fp); // L R C Lb Rb + break; + case 6: + fput32le(0x060f, fp); // L R C Lb Rb LFE + break; + case 7: + fput32le(0x0727, fp); // L R C Cb Ls Rs LFE + break; + case 8: + fput32le(0x063f, fp); // L R C Lb Rb Ls Rs LFE + break; + } + // 2 bytes format + 14 bytes guid + fput32le(fmt, fp); + fput32le(0x00100000, fp); + fput32le(0xAA000080, fp); + fput32le(0x719B3800, fp); + } + + // Data chunk + fput32le(WAV_ID_DATA, fp); + fput32le(data_length, fp); +} + // to set/get/query special features/parameters static int control(int cmd,void *arg){ return -1; @@ -93,7 +138,6 @@ static int control(int cmd,void *arg){ // open & setup audio device // return: 1=success 0=fail static int init(int rate,int channels,int format,int flags){ - int bits; const opt_t subopts[] = { {"waveheader", OPT_ARG_BOOL, &ao_pcm_waveheader, NULL}, {"file", OPT_ARG_MSTRZ, &ao_outputfilename, NULL}, @@ -130,29 +174,12 @@ static int init(int rate,int channels,int format,int flags){ } } - bits = af_fmt2bits(format); - ao_data.outburst = 65536; ao_data.buffersize= 2*65536; ao_data.channels=channels; ao_data.samplerate=rate; ao_data.format=format; - ao_data.bps=channels*rate*(bits/8); - - wavhdr.riff = le2me_32(WAV_ID_RIFF); - wavhdr.wave = le2me_32(WAV_ID_WAVE); - wavhdr.fmt = le2me_32(WAV_ID_FMT); - wavhdr.fmt_length = le2me_32(16); - wavhdr.fmt_tag = le2me_16(format == AF_FORMAT_FLOAT_LE ? WAV_ID_FLOAT_PCM : WAV_ID_PCM); - wavhdr.channels = le2me_16(ao_data.channels); - wavhdr.sample_rate = le2me_32(ao_data.samplerate); - wavhdr.bytes_per_second = le2me_32(ao_data.bps); - wavhdr.bits = le2me_16(bits); - wavhdr.block_align = le2me_16(ao_data.channels * (bits / 8)); - - wavhdr.data = le2me_32(WAV_ID_DATA); - wavhdr.data_length=le2me_32(0x7ffff000); - wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; + ao_data.bps=channels*rate*(af_fmt2bits(format)/8); mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename, (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, @@ -162,7 +189,7 @@ static int init(int rate,int channels,int format,int flags){ fp = fopen(ao_outputfilename, "wb"); if(fp) { if(ao_pcm_waveheader){ /* Reserve space for wave header */ - fwrite(&wavhdr,sizeof(wavhdr),1,fp); + write_wave_header(fp, 0x7ffff000); } return 1; } @@ -186,10 +213,7 @@ static void uninit(int immed){ else if (data_length > 0x7ffff000) mp_msg(MSGT_AO, MSGL_ERR, "File larger than allowed for WAV files, may play truncated!\n"); else { - wavhdr.file_length = data_length + sizeof(wavhdr) - 8; - wavhdr.file_length = le2me_32(wavhdr.file_length); - wavhdr.data_length = le2me_32(data_length); - fwrite(&wavhdr,sizeof(wavhdr),1,fp); + write_wave_header(fp, data_length); } } fclose(fp); @@ -241,7 +265,7 @@ static int play(void* data,int len,int flags){ #endif if (ao_data.channels == 5 || ao_data.channels == 6 || ao_data.channels == 8) { - int frame_size = le2me_16(wavhdr.bits) / 8; + int frame_size = af_fmt2bits(ao_data.format) / 8; len -= len % (frame_size * ao_data.channels); reorder_channel_nch(data, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT, -- cgit v1.2.3 From cc8a878a9cb9688b2eb53b7ee3c6d82bc1555aaf Mon Sep 17 00:00:00 2001 From: tack Date: Mon, 22 Feb 2010 14:27:32 +0000 Subject: Get the proper codec id when a WAVE_FORMAT_EXTENSIBLE extension exists in a wave file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30709 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/aviprint.c | 6 ++++++ libmpdemux/demux_audio.c | 2 ++ libmpdemux/ms_hdr.h | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/libmpdemux/aviprint.c b/libmpdemux/aviprint.c index dc992d5f97..f83bcd3756 100644 --- a/libmpdemux/aviprint.c +++ b/libmpdemux/aviprint.c @@ -89,6 +89,12 @@ void print_wave_header(WAVEFORMATEX *h, int verbose_level){ mp_msg(MSGT_HEADER, verbose_level, "mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock); mp_msg(MSGT_HEADER, verbose_level, "mp3.nCodecDelay=%d\n",h2->nCodecDelay); } + else if (h->wFormatTag == 0xfffe && h->cbSize >= 22) { + WAVEFORMATEXTENSIBLE *h2 = (WAVEFORMATEXTENSIBLE *)h; + mp_msg(MSGT_HEADER, verbose_level, "ex.wValidBitsPerSample=%d\n", h2->wValidBitsPerSample); + mp_msg(MSGT_HEADER, verbose_level, "ex.dwChannelMask=0x%X\n", h2->dwChannelMask); + mp_msg(MSGT_HEADER, verbose_level, "ex.SubFormat=%d (0x%X)\n", h2->SubFormat, h2->SubFormat); + } else if (h->cbSize > 0) { int i; diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c index 63b710427d..9c1c006003 100644 --- a/libmpdemux/demux_audio.c +++ b/libmpdemux/demux_audio.c @@ -416,6 +416,8 @@ static int demux_audio_open(demuxer_t* demuxer) { } stream_read(s,(char*)((char*)(w)+sizeof(WAVEFORMATEX)),w->cbSize); l -= w->cbSize; + if (w->wFormatTag & 0xfffe && w->cbSize >= 22) + sh_audio->format = ((WAVEFORMATEXTENSIBLE *)w)->SubFormat; } if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w, MSGL_V); diff --git a/libmpdemux/ms_hdr.h b/libmpdemux/ms_hdr.h index 2bfefa9ca2..3d6bc07545 100644 --- a/libmpdemux/ms_hdr.h +++ b/libmpdemux/ms_hdr.h @@ -34,6 +34,17 @@ typedef struct __attribute__((__packed__)) _WAVEFORMATEX { } WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; #endif /* _WAVEFORMATEX_ */ +#ifndef _WAVEFORMATEXTENSIBLE_ +#define _WAVEFORMATEXTENSIBLE_ +typedef struct __attribute__((__packed__)) _WAVEFORMATEXTENSIBLE { + WAVEFORMATEX wf; + unsigned short wValidBitsPerSample; + unsigned int dwChannelMask; + unsigned int SubFormat; // Only interested in first 32 bits of guid + unsigned int _guid_remainder[3]; +} WAVEFORMATEXTENSIBLE; +#endif /* _WAVEFORMATEXTENSIBLE_ */ + #ifndef _MPEGLAYER3WAVEFORMAT_ #define _MPEGLAYER3WAVEFORMAT_ typedef struct __attribute__((__packed__)) mpeglayer3waveformat_tag { -- cgit v1.2.3 From 7262f6c9b4f3cd1bd8b98bcc40b74a05aa989ebc Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 22 Feb 2010 15:34:56 +0000 Subject: Properly declare get_term_charset() instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30710 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp_msg.c | 9 +-------- osdep/getch2.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mp_msg.c b/mp_msg.c index 93f793d7c8..a5405c59f4 100644 --- a/mp_msg.c +++ b/mp_msg.c @@ -22,18 +22,11 @@ #include #include "config.h" +#include "osdep/getch2.h" #ifdef CONFIG_ICONV #include #include -/** - * \brief gets the name of the system's terminal character set - * \return a malloced string indicating the system charset - * - * Be warned that this function on many systems is in no way thread-safe - * since it modifies global data - */ -char* get_term_charset(void); #endif #if defined(FOR_MENCODER) diff --git a/osdep/getch2.h b/osdep/getch2.h index f6f416b2a7..35e9801970 100644 --- a/osdep/getch2.h +++ b/osdep/getch2.h @@ -24,6 +24,8 @@ #ifndef MPLAYER_GETCH2_H #define MPLAYER_GETCH2_H +#include "config.h" + /* Screen size. Initialized by load_termcap() and get_screen_size() */ extern int screen_width; extern int screen_height; @@ -44,6 +46,17 @@ void getch2_disable(void); /* Read a character or a special key code (see keycodes.h) */ void getch2(void); +#ifdef CONFIG_ICONV +/** + * \brief gets the name of the system's terminal character set + * \return a malloced string indicating the system charset + * + * Be warned that this function on many systems is in no way thread-safe + * since it modifies global data + */ +char *get_term_charset(void); +#endif + /* slave cmd function for Windows and OS/2 */ int mp_input_slave_cmd_func(int fd,char* dest,int size); -- cgit v1.2.3 From 6676504bbe3ba356585bfc64ee1624ddbecb37ee Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 22 Feb 2010 15:35:53 +0000 Subject: Conditionally declare mp_input_slave_cmd_func(). It does only get compiled on MinGW and OS/2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30711 b3059339-0415-0410-9bf9-f77b7e298cf2 --- osdep/getch2.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osdep/getch2.h b/osdep/getch2.h index 35e9801970..5ee6108fc3 100644 --- a/osdep/getch2.h +++ b/osdep/getch2.h @@ -57,10 +57,9 @@ void getch2(void); char *get_term_charset(void); #endif +#if defined(__MINGW32__) || defined(__OS2__) /* slave cmd function for Windows and OS/2 */ int mp_input_slave_cmd_func(int fd,char* dest,int size); - -#if defined(__MINGW32__) || defined(__OS2__) #define USE_SELECT 0 #define MP_INPUT_SLAVE_CMD_FUNC mp_input_slave_cmd_func #else -- cgit v1.2.3 From 202fbbecdfd6983d6133eb07567eb82852244ba9 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 22 Feb 2010 16:32:03 +0000 Subject: Mark vcd_get_track_end () and vcd_read_toc() as static. They are only used within the respective files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30712 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/vcd_read.h | 4 ++-- stream/vcd_read_darwin.h | 4 ++-- stream/vcd_read_fbsd.h | 4 ++-- stream/vcd_read_win32.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stream/vcd_read.h b/stream/vcd_read.h index 2f60d518ad..2911186d20 100644 --- a/stream/vcd_read.h +++ b/stream/vcd_read.h @@ -72,7 +72,7 @@ int vcd_seek_to_track(mp_vcd_priv_t* vcd,int track){ return VCD_SECTOR_DATA*vcd_get_msf(vcd); } -int vcd_get_track_end(mp_vcd_priv_t* vcd,int track){ +static int vcd_get_track_end(mp_vcd_priv_t* vcd,int track){ vcd->entry.cdte_format = CDROM_MSF; vcd->entry.cdte_track = tracktochdr.cdth_trk1?(track+1):CDROM_LEADOUT; if (ioctl(vcd->fd, CDROMREADTOCENTRY, &vcd->entry)) { @@ -82,7 +82,7 @@ int vcd_get_track_end(mp_vcd_priv_t* vcd,int track){ return VCD_SECTOR_DATA*vcd_get_msf(vcd); } -mp_vcd_priv_t* vcd_read_toc(int fd){ +static mp_vcd_priv_t* vcd_read_toc(int fd){ struct cdrom_tochdr tochdr; mp_vcd_priv_t* vcd; int i, min = 0, sec = 0, frame = 0; diff --git a/stream/vcd_read_darwin.h b/stream/vcd_read_darwin.h index 4d4a0334ba..20f1782049 100644 --- a/stream/vcd_read_darwin.h +++ b/stream/vcd_read_darwin.h @@ -86,7 +86,7 @@ int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track) return VCD_SECTOR_DATA*vcd_get_msf(vcd); } -int vcd_get_track_end(mp_vcd_priv_t* vcd, int track) +static int vcd_get_track_end(mp_vcd_priv_t* vcd, int track) { struct CDTrackInfo entry; @@ -117,7 +117,7 @@ int vcd_get_track_end(mp_vcd_priv_t* vcd, int track) return VCD_SECTOR_DATA*vcd_get_msf(vcd); } -mp_vcd_priv_t* vcd_read_toc(int fd) +static mp_vcd_priv_t* vcd_read_toc(int fd) { dk_cd_read_disc_info_t tochdr; struct CDDiscInfo hdr; diff --git a/stream/vcd_read_fbsd.h b/stream/vcd_read_fbsd.h index e60590e1f5..a9555f5b9e 100644 --- a/stream/vcd_read_fbsd.h +++ b/stream/vcd_read_fbsd.h @@ -144,7 +144,7 @@ vcd_seek_to_track(mp_vcd_priv_t* vcd, int track) return VCD_SECTOR_DATA * vcd_get_msf(vcd); } -int +static int vcd_get_track_end(mp_vcd_priv_t* vcd, int track) { if (!read_toc_entry(vcd, @@ -153,7 +153,7 @@ vcd_get_track_end(mp_vcd_priv_t* vcd, int track) return VCD_SECTOR_DATA * vcd_get_msf(vcd); } -mp_vcd_priv_t* +static mp_vcd_priv_t* vcd_read_toc(int fd) { struct ioc_toc_header tochdr; diff --git a/stream/vcd_read_win32.h b/stream/vcd_read_win32.h index f0b7bd45ef..3b93a76b0a 100644 --- a/stream/vcd_read_win32.h +++ b/stream/vcd_read_win32.h @@ -63,14 +63,14 @@ int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track) return VCD_SECTOR_DATA * (sect + 2); } -int vcd_get_track_end(mp_vcd_priv_t* vcd, int track) +static int vcd_get_track_end(mp_vcd_priv_t* vcd, int track) { if (track < vcd->toc.FirstTrack || track > vcd->toc.LastTrack) return -1; return VCD_SECTOR_DATA * (vcd_get_msf(vcd, track + 1)); } -mp_vcd_priv_t* vcd_read_toc(int fd) +static mp_vcd_priv_t* vcd_read_toc(int fd) { DWORD dwBytesReturned; HANDLE hd; -- cgit v1.2.3 From 9f40f991f3d9beead65a4dc2ff891f57ac626fc3 Mon Sep 17 00:00:00 2001 From: tack Date: Mon, 22 Feb 2010 17:06:24 +0000 Subject: Update my (Jason Tackaberry) email address and contributions in AUTHORS file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30713 b3059339-0415-0410-9bf9-f77b7e298cf2 --- AUTHORS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 868afafba0..ed2c0bfdaa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -768,8 +768,11 @@ Syrjälä, Ville Szecsi, Gabor * directsound AO driver -Tackaberry, Jason +Tackaberry, Jason * second DVD ripping guide + * multichannel audio fixes + * support for 8 channel audio + * various minor features and bug fixes Tam, Howell (Pigeon) * native libcaca driver (-vo caca) -- cgit v1.2.3 From 42beaf6883932af7e42f4d629522ead4284e5cae Mon Sep 17 00:00:00 2001 From: tack Date: Mon, 22 Feb 2010 19:17:25 +0000 Subject: Clarify that AC3/DTS passthrough is also possible with HDMI. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30714 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/xml/en/usage.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DOCS/xml/en/usage.xml b/DOCS/xml/en/usage.xml index 2e9ef0e87f..72dc210e87 100644 --- a/DOCS/xml/en/usage.xml +++ b/DOCS/xml/en/usage.xml @@ -550,7 +550,8 @@ DVDs usually have surround audio encoded in AC-3 (Dolby Digital) or DTS (Digital Theater System) format. Some modern audio equipment is capable of decoding these formats internally. MPlayer can be configured to relay the audio data without decoding it. This will only work if -you have a S/PDIF (Sony/Philips Digital Interface) jack in your sound card. +you have a S/PDIF (Sony/Philips Digital Interface) jack in your sound card, or +if you are passing audio over HDMI. -- cgit v1.2.3 From 38648cae06d53dd4ddbed5fe3410398760e5c462 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 22 Feb 2010 21:53:06 +0000 Subject: Mark sleep_accurate() as static, it is only used within the file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30715 b3059339-0415-0410-9bf9-f77b7e298cf2 --- osdep/timer-darwin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osdep/timer-darwin.c b/osdep/timer-darwin.c index c292852c27..1833694015 100644 --- a/osdep/timer-darwin.c +++ b/osdep/timer-darwin.c @@ -35,7 +35,7 @@ const char *timer_name = "Darwin accurate"; /* the core sleep function, uses floats and is used in MPlayer G2 */ -float sleep_accurate(float time_frame) +static float sleep_accurate(float time_frame) { uint64_t deadline = time_frame / timebase_ratio + mach_absolute_time(); -- cgit v1.2.3 From 9c0f9900ee92f1fae5901aeec00fe088d7227aa0 Mon Sep 17 00:00:00 2001 From: zuxy Date: Tue, 23 Feb 2010 06:42:51 +0000 Subject: Reset output color after each line. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30716 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp_msg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mp_msg.c b/mp_msg.c index a5405c59f4..8d93c68c6e 100644 --- a/mp_msg.c +++ b/mp_msg.c @@ -238,5 +238,7 @@ void mp_msg(int mod, int lev, const char *format, ... ){ header = tmp[strlen(tmp)-1] == '\n' || tmp[strlen(tmp)-1] == '\r'; fprintf(stream, "%s", tmp); + if (mp_msg_color) + fprintf(stream, "\033[0m"); fflush(stream); } -- cgit v1.2.3 From 5405958e341f4de535d60b0f6eb13bcc6091f956 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 23 Feb 2010 07:54:10 +0000 Subject: Add header for macosx_finder_args() instead of forward declaring it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30717 b3059339-0415-0410-9bf9-f77b7e298cf2 --- osdep/macosx_finder_args.c | 1 + osdep/macosx_finder_args.h | 26 ++++++++++++++++++++++++++ parser-mpcmd.c | 4 +--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 osdep/macosx_finder_args.h diff --git a/osdep/macosx_finder_args.c b/osdep/macosx_finder_args.c index 81c1959894..cbd88ad4ac 100644 --- a/osdep/macosx_finder_args.c +++ b/osdep/macosx_finder_args.c @@ -23,6 +23,7 @@ #include "m_option.h" #include "m_config.h" #include "playtree.h" +#include "macosx_finder_args.h" static play_tree_t *files=NULL; diff --git a/osdep/macosx_finder_args.h b/osdep/macosx_finder_args.h new file mode 100644 index 0000000000..fd047181a4 --- /dev/null +++ b/osdep/macosx_finder_args.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_MACOSX_FINDER_ARGS_H +#define MPLAYER_MACOSX_FINDER_ARGS_H + +#include "playtree.h" + +play_tree_t *macosx_finder_args(m_config_t *config, int argc, char **argv); + +#endif /* MPLAYER_MACOSX_FINDER_ARGS_H */ diff --git a/parser-mpcmd.c b/parser-mpcmd.c index b493ddf089..b03bcfb05a 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -36,6 +36,7 @@ #include "m_config.h" #include "playtree.h" #include "parser-mpcmd.h" +#include "osdep/macosx_finder_args.h" static int recursion_depth = 0; static int mode = 0; @@ -91,9 +92,6 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) int no_more_opts = 0; int opt_exit = 0; // flag indicating whether mplayer should exit without playing anything play_tree_t *last_parent, *last_entry = NULL, *root; -#ifdef CONFIG_MACOSX_FINDER - play_tree_t *macosx_finder_args(m_config_t *, int , char **); -#endif #ifdef MP_DEBUG assert(config != NULL); -- cgit v1.2.3 From 9c856aeffe6bfa0433df8a4bcfba1fb75b63c23a Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 23 Feb 2010 07:54:43 +0000 Subject: Mark theRenderProc() as static, it is only used within the file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30718 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_coreaudio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libao2/ao_coreaudio.c b/libao2/ao_coreaudio.c index b60fb094e7..36456f3cc6 100644 --- a/libao2/ao_coreaudio.c +++ b/libao2/ao_coreaudio.c @@ -119,7 +119,11 @@ static int read_buffer(unsigned char* data,int len){ return len; } -OSStatus theRenderProc(void *inRefCon, AudioUnitRenderActionFlags *inActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumFrames, AudioBufferList *ioData) +static OSStatus theRenderProc(void *inRefCon, + AudioUnitRenderActionFlags *inActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, UInt32 inNumFrames, + AudioBufferList *ioData) { int amt=av_fifo_size(ao->buffer); int req=(inNumFrames)*ao->packetSize; -- cgit v1.2.3 From dc33991b883b31b0d97893f0cc94390f9110e786 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 23 Feb 2010 07:55:47 +0000 Subject: Add -Wmissing-prototypes to CFLAGS if available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30719 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 93b02eecf3..6e485ece3d 100755 --- a/configure +++ b/configure @@ -2534,6 +2534,7 @@ if test "$cc_vendor" = "gnu" ; then cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS" cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS" cc_check -Wundef && CFLAGS="-Wundef $CFLAGS" + cc_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS" else CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS" fi -- cgit v1.2.3 From 43423627d48e058076d943fc363089ece6c676c3 Mon Sep 17 00:00:00 2001 From: kostya Date: Tue, 23 Feb 2010 09:04:18 +0000 Subject: FFmpeg Bink video now supports alpha channel git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30720 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 23d4f50a97..08ca399a2b 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -19,6 +19,7 @@ videocodec ffbinkvideo driver ffmpeg dll binkvideo out YV12 + out 420A videocodec ffcdgraphics info "FFmpeg CD-Graphics" -- cgit v1.2.3 From 0139c2394aac0934f9c3596aa79e57d37ac44c2c Mon Sep 17 00:00:00 2001 From: compn Date: Tue, 23 Feb 2010 13:40:45 +0000 Subject: add older lhacm codec for formats 0x70-0x73 to codecs.conf git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30721 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 08ca399a2b..40f6696552 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -4539,6 +4539,16 @@ audiocodec lhacm driver acm dll "lhacm.acm" +audiocodec lhacm2 + info "Voxware AC aka Lernout & Hauspie CELP and CBS codecs" + status working + format 0x70 + format 0x71 + format 0x72 + format 0x73 + driver acm + dll "lhacm2.acm" ; aka lhacm.acm md5sum 4585780a8eb71d86df64553b34ba8f79 + audiocodec pscelp info "Philips Speech Processing CELP" status working -- cgit v1.2.3 From eb846cb700ffd8bc964339a411b1f7943df78bb8 Mon Sep 17 00:00:00 2001 From: ramiro Date: Tue, 23 Feb 2010 16:46:43 +0000 Subject: Reorder buffer debug. Also print out if slice was buffered. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30722 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index b682c11d42..bbd9a1f701 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2662,26 +2662,26 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[], assert(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1); assert(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1); + DEBUG_BUFFERS("dstY: %d\n", dstY); + DEBUG_BUFFERS("\tfirstLumSrcY: %d lastLumSrcY: %d lastInLumBuf: %d\n", + firstLumSrcY, lastLumSrcY, lastInLumBuf); + DEBUG_BUFFERS("\tfirstChrSrcY: %d lastChrSrcY: %d lastInChrBuf: %d\n", + firstChrSrcY, lastChrSrcY, lastInChrBuf); + // Do we have enough lines in this slice to output the dstY line enough_lines = lastLumSrcY < srcSliceY + srcSliceH && lastChrSrcY < -((-srcSliceY - srcSliceH)>>c->chrSrcVSubSample); if (!enough_lines) { lastLumSrcY = srcSliceY + srcSliceH - 1; lastChrSrcY = chrSrcSliceY + chrSrcSliceH - 1; + DEBUG_BUFFERS("buffering slice: lastLumSrcY %d lastChrSrcY %d\n", + lastLumSrcY, lastChrSrcY); } - DEBUG_BUFFERS("dstY: %d\n", dstY); - DEBUG_BUFFERS("\tfirstLumSrcY: %d lastLumSrcY: %d lastInLumBuf: %d\n", - firstLumSrcY, lastLumSrcY, lastInLumBuf); - DEBUG_BUFFERS("\tfirstChrSrcY: %d lastChrSrcY: %d lastInChrBuf: %d\n", - firstChrSrcY, lastChrSrcY, lastInChrBuf); - //Do horizontal scaling while(lastInLumBuf < lastLumSrcY) { const uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0]; const uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3]; lumBufIndex++; - DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n", - lumBufIndex, lastInLumBuf); assert(lumBufIndex < 2*vLumBufSize); assert(lastInLumBuf + 1 - srcSliceY < srcSliceH); assert(lastInLumBuf + 1 - srcSliceY >= 0); @@ -2695,13 +2695,13 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[], formatConvBuffer, pal, 1); lastInLumBuf++; + DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n", + lumBufIndex, lastInLumBuf); } while(lastInChrBuf < lastChrSrcY) { const uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1]; const uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2]; chrBufIndex++; - DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n", - chrBufIndex, lastInChrBuf); assert(chrBufIndex < 2*vChrBufSize); assert(lastInChrBuf + 1 - chrSrcSliceY < (chrSrcSliceH)); assert(lastInChrBuf + 1 - chrSrcSliceY >= 0); @@ -2713,6 +2713,8 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[], formatConvBuffer, pal); lastInChrBuf++; + DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n", + chrBufIndex, lastInChrBuf); } //wrap buf index around to stay inside the ring buffer if (lumBufIndex >= vLumBufSize) lumBufIndex-= vLumBufSize; -- cgit v1.2.3 From abc9495e0c0ff3a6f8205855494a222f2aa965ce Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 23 Feb 2010 20:16:30 +0000 Subject: Add #includes for mp_input_check_interrupt() and mplayer_put_key(), fixes: mencoder.c:226: warning: no previous prototype for 'mp_input_check_interrupt' mencoder.c:232: warning: no previous prototype for 'mplayer_put_key' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30723 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mencoder.c b/mencoder.c index 93f10324f4..558e3f5e4b 100644 --- a/mencoder.c +++ b/mencoder.c @@ -62,7 +62,7 @@ #include "m_config.h" #include "parser-mecmd.h" #include "parser-cfg.h" - +#include "mp_fifo.h" #include "get_path.h" #include "stream/stream.h" @@ -72,7 +72,7 @@ #include "libmpdemux/mp3_hdr.h" #include "libmpdemux/muxer.h" - +#include "input/input.h" #include "libvo/video_out.h" #include "libaf/af_format.h" -- cgit v1.2.3 From 1783ce38f687e85bd164e16aff16b64fbdab2dbb Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 23 Feb 2010 22:29:57 +0000 Subject: Fix compilation: the dct64_MMX_func variable should be declared only once, not every time the header is included. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30724 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp3lib/mpg123.h | 2 +- mp3lib/sr1.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mp3lib/mpg123.h b/mp3lib/mpg123.h index 3d98366b4f..5a7548250a 100644 --- a/mp3lib/mpg123.h +++ b/mp3lib/mpg123.h @@ -134,7 +134,7 @@ void dct64_MMX_3dnow(short *, short *, real *); void dct64_MMX_3dnowex(short *, short *, real *); void dct64_sse(short *, short *, real *); void dct64_altivec(real *, real *, real *); -void (*dct64_MMX_func)(short *, short *, real *); +extern void (*dct64_MMX_func)(short *, short *, real *); void mp3lib_dct64(real *, real *, real *); diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c index 72502d61ee..694961ebc0 100644 --- a/mp3lib/sr1.c +++ b/mp3lib/sr1.c @@ -387,6 +387,8 @@ static int _has_mmx = 0; // used by layer2.c, layer3.c to pre-scale coeffs /* PUBLIC FUNCTIONS */ /******************************************************************************/ +void (*dct64_MMX_func)(short *, short *, real *); + #include "layer2.c" #include "layer3.c" #include "layer1.c" -- cgit v1.2.3 From 70647bb9cb5cf34f924d553fc184fed23764adb3 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 23 Feb 2010 23:33:10 +0000 Subject: Disable old-style implicit rules to fix MinGW/Cygwin compilation (mplayer-rc.o can not be generated). TO be improved or removed if/when someone figures out the issue. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30725 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 6c2c26821e..82f6331b2c 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ include config.mak +.SUFFIXES: ###### variable declarations ####### @@ -837,6 +838,15 @@ all: $(ALL_PRG-yes) %.ho: %.h $(CC) $(CFLAGS) -Wno-unused -c -o $@ -x c $< +%.o: %.S + $(CC) $(ASFLAGS) -c -o $@ $< + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +%.o: %.cpp + $(CC) $(CXXFLAGS) -c -o $@ $< + %.o: %.m $(CC) $(CFLAGS) -c -o $@ $< -- cgit v1.2.3 From b2e8cf6bc2996ec7116e71bec6dff9080e9eacff Mon Sep 17 00:00:00 2001 From: zuxy Date: Thu, 25 Feb 2010 08:39:55 +0000 Subject: Include libmpcodecs/vd.h for declaration of "fullscreen". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30726 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/win32/gui.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/win32/gui.c b/gui/win32/gui.c index 66940bc209..d76077d41a 100644 --- a/gui/win32/gui.c +++ b/gui/win32/gui.c @@ -39,6 +39,7 @@ #include "osdep/keycodes.h" #include "stream/stream.h" #include "libvo/video_out.h" +#include "libmpcodecs/vd.h" #include "gui/interface.h" #include "gui/mplayer/gmplayer.h" #include "gui.h" -- cgit v1.2.3 From 16d8b08089a0a99c2f6e4b667cad899d7ac1e950 Mon Sep 17 00:00:00 2001 From: komh Date: Thu, 25 Feb 2010 09:09:57 +0000 Subject: Define O_BINARY if it is undefined. This removes a platform check for open(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30727 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_cddb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c index 3a2ecf41ad..1f8d44a005 100644 --- a/stream/stream_cddb.c +++ b/stream/stream_cddb.c @@ -74,6 +74,10 @@ #include "network.h" #include "libavutil/common.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #define DEFAULT_FREEDB_SERVER "freedb.freedb.org" #define DEFAULT_CACHE_DIR "/.cddb/" @@ -349,11 +353,7 @@ int cddb_read_cache(cddb_data_t *cddb_data) sprintf(file_name, "%s%08lx", cddb_data->cache_dir, cddb_data->disc_id); - file_fd = open(file_name, O_RDONLY -#if defined(__MINGW32__) || defined(__CYGWIN__) - | O_BINARY -#endif - ); + file_fd = open(file_name, O_RDONLY | O_BINARY); if (file_fd < 0) { mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_NoCacheFound); return -1; -- cgit v1.2.3 From 2074d1a3e7c3866f25a0e5cfb60025dd44cc7f89 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 25 Feb 2010 13:20:56 +0000 Subject: Unconditionally declare fast_memcpy() and mem2agpcpy(). This fixes the following warnings on non-x86 systems: libvo/aclib.c:162: warning: no previous prototype for 'fast_memcpy' libvo/aclib.c:196: warning: no previous prototype for 'mem2agpcpy' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30728 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/fastmemcpy.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index 16767d9842..a28f495486 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -22,14 +22,12 @@ #include "config.h" #include #include - -#if defined(CONFIG_FASTMEMCPY) && (HAVE_MMX || HAVE_MMX2 || HAVE_AMD3DNOW /* || HAVE_SSE || HAVE_SSE2 */) #include void * fast_memcpy(void * to, const void * from, size_t len); void * mem2agpcpy(void * to, const void * from, size_t len); -#else +#if ! defined(CONFIG_FASTMEMCPY) && ! (HAVE_MMX || HAVE_MMX2 || HAVE_AMD3DNOW /* || HAVE_SSE || HAVE_SSE2 */) #define mem2agpcpy(a,b,c) memcpy(a,b,c) #define fast_memcpy(a,b,c) memcpy(a,b,c) #endif -- cgit v1.2.3 From 83b756a65d5318ad2f64041b0b16a00fc4295685 Mon Sep 17 00:00:00 2001 From: stefano Date: Thu, 25 Feb 2010 21:12:38 +0000 Subject: Apply consistency nit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30729 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/yuv2rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index a019bf76fd..2a05477bda 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -49,7 +49,7 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = { {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */ }; -const int * sws_getCoefficients(int colorspace) +const int *sws_getCoefficients(int colorspace) { if (colorspace > 7 || colorspace < 0) colorspace = SWS_CS_DEFAULT; -- cgit v1.2.3 From 150de6566ffc1ce102665da0e4bb4bb7c1e0afd6 Mon Sep 17 00:00:00 2001 From: stefano Date: Thu, 25 Feb 2010 21:21:29 +0000 Subject: Remove pointless empty line. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30730 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/utils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 99bc663840..22141544b9 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -787,7 +787,6 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) { - SwsContext *c; int i; int usesVFilter, usesHFilter; -- cgit v1.2.3 From adc345131f947569f9b6e490119ad9969c09529e Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 25 Feb 2010 21:27:22 +0000 Subject: Fix silly type of guiGetEvent argument to use void * instead of char * and get rid of some of the insane amount of casts necessary to hide the utter idiocy of the type used before. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30731 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/interface.c | 18 +++++++++--------- gui/interface.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gui/interface.c b/gui/interface.c index 83e897d267..8040f5c92c 100644 --- a/gui/interface.c +++ b/gui/interface.c @@ -523,15 +523,15 @@ static void remove_vf( char * str ) } } -int guiGetEvent( int type,char * arg ) +int guiGetEvent( int type,void * arg ) { const ao_functions_t *audio_out = NULL; const vo_functions_t *video_out = NULL; mixer_t *mixer = NULL; - stream_t * stream = (stream_t *) arg; + stream_t * stream = arg; #ifdef CONFIG_DVDREAD - dvd_priv_t * dvdp = (dvd_priv_t *) arg; + dvd_priv_t * dvdp = arg; #endif if (guiIntfStruct.mpcontext) { @@ -543,8 +543,8 @@ int guiGetEvent( int type,char * arg ) switch ( type ) { case guiXEvent: - guiIntfStruct.event_struct=(void *)arg; - wsEvents( wsDisplay,(XEvent *)arg,NULL ); + guiIntfStruct.event_struct=arg; + wsEvents( wsDisplay,arg,NULL ); gtkEventHandling(); break; case guiCEvent: @@ -574,12 +574,12 @@ int guiGetEvent( int type,char * arg ) else wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); break; case guiSetContext: - guiIntfStruct.mpcontext=(void *)arg; + guiIntfStruct.mpcontext=arg; case guiSetDemuxer: - guiIntfStruct.demuxer=(void *)arg; + guiIntfStruct.demuxer=arg; break; case guiSetAfilter: - guiIntfStruct.afilter=(void *)arg; + guiIntfStruct.afilter=arg; break; case guiSetShVideo: { @@ -675,7 +675,7 @@ int guiGetEvent( int type,char * arg ) guiIntfStruct.sh_video=arg; if ( arg ) { - sh_video_t * sh = (sh_video_t *)arg; + sh_video_t * sh = arg; guiIntfStruct.FPS=sh->fps; } diff --git a/gui/interface.h b/gui/interface.h index 59d0cbac47..075fa29422 100644 --- a/gui/interface.h +++ b/gui/interface.h @@ -163,7 +163,7 @@ extern int use_gui; void guiInit( void ); void guiDone( void ); -int guiGetEvent( int type,char * arg ); +int guiGetEvent( int type,void * arg ); void guiEventHandling( void ); void guiLoadFont( void ); void guiLoadSubtitle( char * name ); -- cgit v1.2.3 From 5a2289137f43501281dba83fe98b5f67be63f9ef Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 25 Feb 2010 22:06:05 +0000 Subject: Fix check for wrong variable: len can be unitialized but not normally < 0, the return value needs to be checked to detect an error. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30732 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_hwmpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpcodecs/ad_hwmpa.c b/libmpcodecs/ad_hwmpa.c index fe804e1e13..30caa9b0f9 100644 --- a/libmpcodecs/ad_hwmpa.c +++ b/libmpcodecs/ad_hwmpa.c @@ -151,7 +151,7 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...) return CONTROL_FALSE; case ADCTRL_SKIP_FRAME: start = mpa_sync(sh, 2, &len, NULL, NULL, NULL, NULL, NULL); - if(len < 0) + if(start < 0) return CONTROL_FALSE; sh->a_in_buffer_len -= start; -- cgit v1.2.3