summaryrefslogtreecommitdiffstats
path: root/libao2/ao_alsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'libao2/ao_alsa.c')
-rw-r--r--libao2/ao_alsa.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c
index 70cd92198b..c156404ab7 100644
--- a/libao2/ao_alsa.c
+++ b/libao2/ao_alsa.c
@@ -127,7 +127,7 @@ static int control(int cmd, void *arg)
long get_vol, set_vol;
float f_multi;
- if(ao_data.format == AF_FORMAT_AC3)
+ if(AF_FORMAT_IS_AC3(ao_data.format))
return CONTROL_TRUE;
if(mixer_channel) {
@@ -427,7 +427,7 @@ static int init(int rate_hz, int channels, int format, int flags)
* while opening the abstract alias for the spdif subdevice
* 'iec958'
*/
- if (format == AF_FORMAT_AC3) {
+ if (AF_FORMAT_IS_AC3(format)) {
device.str = "iec958";
mp_msg(MSGT_AO,MSGL_V,"alsa-spdif-init: playing AC3, %i channels\n", channels);
}
@@ -486,12 +486,13 @@ static int init(int rate_hz, int channels, int format, int flags)
}
if (!alsa_handler) {
+ int isac3 = AF_FORMAT_IS_AC3(format);
//modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC
- if ((err = try_open_device(alsa_device, open_mode, format == AF_FORMAT_AC3)) < 0)
+ if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0)
{
if (err != -EBUSY && ao_noblock) {
mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed);
- if ((err = try_open_device(alsa_device, 0, format == AF_FORMAT_AC3)) < 0) {
+ if ((err = try_open_device(alsa_device, 0, isac3)) < 0) {
mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err));
return 0;
}