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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c
index ff837e7d30..0c40146843 100644
--- a/libao2/ao_alsa.c
+++ b/libao2/ao_alsa.c
@@ -115,7 +115,7 @@ static int control(int cmd, void *arg)
long get_vol, set_vol;
float f_multi;
- if(AF_FORMAT_IS_AC3(ao_data.format))
+ if(AF_FORMAT_IS_AC3(ao_data.format) || AF_FORMAT_IS_IEC61937(ao_data.format))
return CONTROL_TRUE;
if(mixer_channel) {
@@ -380,10 +380,12 @@ static int init(int rate_hz, int channels, int format, int flags)
break;
case AF_FORMAT_AC3_LE:
case AF_FORMAT_S16_LE:
+ case AF_FORMAT_IEC61937_LE:
alsa_format = SND_PCM_FORMAT_S16_LE;
break;
case AF_FORMAT_AC3_BE:
case AF_FORMAT_S16_BE:
+ case AF_FORMAT_IEC61937_BE:
alsa_format = SND_PCM_FORMAT_S16_BE;
break;
case AF_FORMAT_U32_LE:
@@ -437,9 +439,9 @@ static int init(int rate_hz, int channels, int format, int flags)
* while opening the abstract alias for the spdif subdevice
* 'iec958'
*/
- if (AF_FORMAT_IS_AC3(format)) {
+ if (AF_FORMAT_IS_AC3(format) || AF_FORMAT_IS_IEC61937(format)) {
device.str = "iec958";
- mp_msg(MSGT_AO,MSGL_V,"alsa-spdif-init: playing AC3, %i channels\n", channels);
+ mp_msg(MSGT_AO,MSGL_V,"alsa-spdif-init: playing AC3/iec61937/iec958, %i channels\n", channels);
}
else
/* in any case for multichannel playback we should select
@@ -488,7 +490,7 @@ static int init(int rate_hz, int channels, int format, int flags)
if (!alsa_handler) {
int open_mode = block ? 0 : SND_PCM_NONBLOCK;
- int isac3 = AF_FORMAT_IS_AC3(format);
+ int isac3 = AF_FORMAT_IS_AC3(format) || AF_FORMAT_IS_IEC61937(format);
//modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC
if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0)
{
@@ -539,6 +541,8 @@ static int init(int rate_hz, int channels, int format, int flags)
alsa_format = SND_PCM_FORMAT_S16_LE;
if (AF_FORMAT_IS_AC3(ao_data.format))
ao_data.format = AF_FORMAT_AC3_LE;
+ else if (AF_FORMAT_IS_IEC61937(ao_data.format))
+ ao_data.format = AF_FORMAT_IEC61937_LE;
else
ao_data.format = AF_FORMAT_S16_LE;
}