mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
set the nearest number of channels, return(0) upon errors
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16309 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
341e1c97e9
commit
4b40fd60f0
@ -548,13 +548,15 @@ static int init(int rate_hz, int channels, int format, int flags)
|
||||
{
|
||||
mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set format: %s\n",
|
||||
snd_strerror(err));
|
||||
return(0);
|
||||
}
|
||||
|
||||
if ((err = snd_pcm_hw_params_set_channels(alsa_handler, alsa_hwparams,
|
||||
ao_data.channels)) < 0)
|
||||
if ((err = snd_pcm_hw_params_set_channels_near(alsa_handler, alsa_hwparams,
|
||||
&ao_data.channels)) < 0)
|
||||
{
|
||||
mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set channels: %s\n",
|
||||
snd_strerror(err));
|
||||
return(0);
|
||||
}
|
||||
|
||||
if ((err = snd_pcm_hw_params_set_rate_near(alsa_handler, alsa_hwparams,
|
||||
|
Loading…
Reference in New Issue
Block a user