From 051d3210c7fd77c59e031e6354ed01be1a8deb17 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 18:11:15 +0000 Subject: [PATCH 1/8] Remove useless initializers. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30441 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 1ad746123a..c9caa12825 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -74,9 +74,9 @@ static snd_pcm_sw_params_t *alsa_swparams; static size_t bytes_per_sample; -static int ao_noblock = 0; +static int ao_noblock; -static int alsa_can_pause = 0; +static int alsa_can_pause; #define ALSA_DEVICE_SIZE 256 From 5f326498f7e2de70361785baf4516e54dd2294ab Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 18:16:41 +0000 Subject: [PATCH 2/8] Do not needlessly make local variable static. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30442 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index c9caa12825..a117c95965 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -115,9 +115,9 @@ static int control(int cmd, void *arg) snd_mixer_elem_t *elem; snd_mixer_selem_id_t *sid; - static char *mix_name = "PCM"; - static char *card = "default"; - static int mix_index = 0; + char *mix_name = "PCM"; + char *card = "default"; + int mix_index = 0; long pmin, pmax; long get_vol, set_vol; From 882ce0cd5e26f1b8d4360ba2a390670cc1f4ca6b Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 18:21:27 +0000 Subject: [PATCH 3/8] Remove a useless global variable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30443 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index a117c95965..c46e3a0d41 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -74,8 +74,6 @@ static snd_pcm_sw_params_t *alsa_swparams; static size_t bytes_per_sample; -static int ao_noblock; - static int alsa_can_pause; #define ALSA_DEVICE_SIZE 256 @@ -467,13 +465,12 @@ static int init(int rate_hz, int channels, int format, int flags) print_help(); return 0; } - ao_noblock = !block; parse_device(alsa_device, device.str, device.len); mp_msg(MSGT_AO,MSGL_V,"alsa-init: using device %s\n", alsa_device); //setting modes for block or nonblock-mode - if (ao_noblock) { + if (!block) { open_mode = SND_PCM_NONBLOCK; } else { @@ -485,7 +482,7 @@ static int init(int rate_hz, int channels, int format, int flags) //modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0) { - if (err != -EBUSY && ao_noblock) { + if (err != -EBUSY && !block) { mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed); if ((err = try_open_device(alsa_device, 0, isac3)) < 0) { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); From 4c211d8851d21b05af89c81375784970348da80b Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 18:23:19 +0000 Subject: [PATCH 4/8] Declare variable closer to where it is used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30444 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index c46e3a0d41..dd99d348b6 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -315,7 +315,6 @@ static int init(int rate_hz, int channels, int format, int flags) { unsigned int alsa_buffer_time = 500000; /* 0.5 s */ unsigned int alsa_fragcount = 16; - int open_mode; int err; int block; strarg_t device; @@ -469,15 +468,8 @@ static int init(int rate_hz, int channels, int format, int flags) mp_msg(MSGT_AO,MSGL_V,"alsa-init: using device %s\n", alsa_device); - //setting modes for block or nonblock-mode - if (!block) { - open_mode = SND_PCM_NONBLOCK; - } - else { - open_mode = 0; - } - if (!alsa_handler) { + int open_mode = block ? 0 : SND_PCM_NONBLOCK; int isac3 = AF_FORMAT_IS_AC3(format); //modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0) From d1ec4a57bab7eb2cb1cb44b9e8951c7fead025df Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 19:15:49 +0000 Subject: [PATCH 5/8] Make mp3lib the default MP3 decoder again, it is a good bit faster on standard desktop hardware. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30445 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index bf344dcac1..d018d2d0a2 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -4029,6 +4029,23 @@ audiocodec ffsonic driver ffmpeg dll "sonic" +audiocodec mp3 + ; this is preferred over ffmp2/ffmp3 since it is faster due to using + ; floating point and there are even broken mkv files where the audio + ; needs to be parsed, making this codec work more reliably + info "mp3lib MPEG layer-2, layer-3" + status working + comment "Optimized to MMX/SSE/3Dnow!" + format 0x50 ; layer-1 && layer-2 + format 0x55 ; layer-3 + format 0x5500736d ; "ms\0\x55" older mp3 fcc (MOV files) + format 0x5000736d ; "ms\0\x50" older mp2 fcc (MOV files) + format 0x55005354 ; broken file + fourcc ".mp3" ; CBR/VBR MP3 (MOV files) + fourcc "MP3 " ; used in .nsv files + fourcc "LAME" ; used in mythtv .nuv files + driver mp3lib + audiocodec ffmp3on4 info "FFmpeg Multi-channel MPEG layer-3 on MP4 audio" status working @@ -4068,20 +4085,6 @@ audiocodec ffmp2 driver ffmpeg dll "mp2" -audiocodec mp3 - info "mp3lib MPEG layer-2, layer-3" - status working - comment "Optimized to MMX/SSE/3Dnow!" - format 0x50 ; layer-1 && layer-2 - format 0x55 ; layer-3 - format 0x5500736d ; "ms\0\x55" older mp3 fcc (MOV files) - format 0x5000736d ; "ms\0\x50" older mp2 fcc (MOV files) - format 0x55005354 ; broken file - fourcc ".mp3" ; CBR/VBR MP3 (MOV files) - fourcc "MP3 " ; used in .nsv files - fourcc "LAME" ; used in mythtv .nuv files - driver mp3lib - audiocodec mad info "libMAD MPEG layer 1-2-3" status working From 4526f4da65bc00d61d242a1af959529ea4555caa Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 19:42:24 +0000 Subject: [PATCH 6/8] Fix newline removal code that might read and write out of bounds. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30446 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/skin/font.c | 4 ++-- gui/skin/skin.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/skin/font.c b/gui/skin/font.c index f565289925..e3f1bee5cc 100644 --- a/gui/skin/font.c +++ b/gui/skin/font.c @@ -87,8 +87,8 @@ int fntRead( char * path,char * fname ) { fgets( tmp,255,f ); linenumber++; - c=tmp[ strlen( tmp ) - 1 ]; if ( ( c == '\n' )||( c == '\r' ) ) tmp[ strlen( tmp ) - 1 ]=0; - c=tmp[ strlen( tmp ) - 1 ]; if ( ( c == '\n' )||( c == '\r' ) ) tmp[ strlen( tmp ) - 1 ]=0; + // remove any kind of newline, if any + tmp[strcspn(tmp, "\n\r")] = 0; for ( c=0;c < (int)strlen( tmp );c++ ) if ( tmp[c] == ';' ) { tmp[c]=0; break; } if ( !tmp[0] ) continue; diff --git a/gui/skin/skin.c b/gui/skin/skin.c index 50d31b74d7..fc0a5e40ab 100644 --- a/gui/skin/skin.c +++ b/gui/skin/skin.c @@ -717,8 +717,8 @@ int skinRead( char * dname ) { linenumber++; - c=tmp[ strlen( tmp ) - 1 ]; if ( c == '\n' || c == '\r' ) tmp[ strlen( tmp ) - 1 ]=0; - c=tmp[ strlen( tmp ) - 1 ]; if ( c == '\n' || c == '\r' ) tmp[ strlen( tmp ) - 1 ]=0; + // remove any kind of newline, if any + tmp[strcspn(tmp, "\n\r")] = 0; for ( c=0;c<(int)strlen( tmp );c++ ) if ( tmp[c] == ';' ) { From 1a7b69f7f2e670b7c09baddbdd619db72091e647 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 27 Jan 2010 19:45:16 +0000 Subject: [PATCH 7/8] Simplify and correct loop condition, also avoids a compiler warning for unused result. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30447 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/skin/font.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/skin/font.c b/gui/skin/font.c index e3f1bee5cc..2da2148c41 100644 --- a/gui/skin/font.c +++ b/gui/skin/font.c @@ -83,9 +83,9 @@ int fntRead( char * path,char * fname ) if ( ( f=fopen( tmp,"rt" ) ) == NULL ) { free( Fonts[id] ); return -3; } - while ( !feof( f ) ) + while ( fgets( tmp,255,f ) ) { - fgets( tmp,255,f ); linenumber++; + linenumber++; // remove any kind of newline, if any tmp[strcspn(tmp, "\n\r")] = 0; From 9b6b3ff08c3f0c5151a379cabd08cfb0fa309f79 Mon Sep 17 00:00:00 2001 From: attila Date: Wed, 27 Jan 2010 22:22:50 +0000 Subject: [PATCH 8/8] Stopping maintainership for -vo (x)mga git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30448 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/tech/MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DOCS/tech/MAINTAINERS b/DOCS/tech/MAINTAINERS index 79fc0c5c2e..7b7b1c710c 100644 --- a/DOCS/tech/MAINTAINERS +++ b/DOCS/tech/MAINTAINERS @@ -174,7 +174,7 @@ libvo drivers: * vo_ivtv.c - Benjamin Zores * vo_jpeg.c - Ivo van Poorten * vo_md5sum.c - Ivo van Poorten - * vo_mga.c - Attila Kinali + * vo_mga.c - None * vo_mpegpes.c - None * vo_null.c - None * vo_png.c - Felix Bünemann @@ -188,7 +188,7 @@ libvo drivers: * vo_wii.c - Benjamin Zores * vo_winvidix.c - Sascha Sommer * vo_x11.c - Alexander Strasser - * vo_xmga.c - Attila Kinali + * vo_xmga.c - None * vo_xover.c - Alban Bedel * vo_xv.c - Alexander Strasser * vo_xvidix.c - None