diff options
author | cladisch <cladisch@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-13 10:50:37 +0000 |
---|---|---|
committer | cladisch <cladisch@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-13 10:50:37 +0000 |
commit | b263a6618e8ba45dc3f596f10a60ae444e0d5f5f (patch) | |
tree | 827f3cc5f58a22b0599eb9dede11843ce40227dd /libao2/ao_alsa.c | |
parent | 6bab259faf696972785525734b20a05e6c1a93d8 (diff) | |
download | mpv-b263a6618e8ba45dc3f596f10a60ae444e0d5f5f.tar.bz2 mpv-b263a6618e8ba45dc3f596f10a60ae444e0d5f5f.tar.xz |
To avoid a bug in ALSA's rate plugin that causes spurious overruns, try
to disable it so that mplayer's resampler is used.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17850 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_alsa.c')
-rw-r--r-- | libao2/ao_alsa.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index bff2cb6270..8136315b5c 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -533,6 +533,18 @@ static int init(int rate_hz, int channels, int format, int flags) return(0); } + /* workaround for buggy rate plugin (should be fixed in ALSA 1.0.11) + prefer our own resampler */ +#if SND_LIB_VERSION >= 0x010009 + if ((err = snd_pcm_hw_params_set_rate_resample(alsa_handler, alsa_hwparams, + 0)) < 0) + { + mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to disable resampling: %s\n", + snd_strerror(err)); + return(0); + } +#endif + if ((err = snd_pcm_hw_params_set_rate_near(alsa_handler, alsa_hwparams, &ao_data.samplerate, NULL)) < 0) { |