summaryrefslogtreecommitdiffstats
path: root/libao2/ao_alsa.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-17 20:03:55 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-17 20:03:55 +0000
commitefeaeab3c450bfa3484becb9fe4bdd0d7eb143fa (patch)
tree5377e0732b8e8d1c0366ce678d39e909b0d40303 /libao2/ao_alsa.c
parent69a5c44698afc17f8f936c426c00a8af8d17fa9c (diff)
downloadmpv-efeaeab3c450bfa3484becb9fe4bdd0d7eb143fa.tar.bz2
mpv-efeaeab3c450bfa3484becb9fe4bdd0d7eb143fa.tar.xz
Only use S/PDIF output when no other alsa device is set, allows to use
external ac3 decoders. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13662 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_alsa.c')
-rw-r--r--libao2/ao_alsa.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c
index 7089e8810f..85a13289a4 100644
--- a/libao2/ao_alsa.c
+++ b/libao2/ao_alsa.c
@@ -405,6 +405,7 @@ static int init(int rate_hz, int channels, int format, int flags)
}
}
+ if (!device_set) {
/* switch for spdif
* sets opening sequence for SPDIF
* sets also the playback and other switches 'on the fly'
@@ -430,24 +431,21 @@ static int init(int rate_hz, int channels, int format, int flags)
s[0], s[1], s[2], s[3]);
mp_msg(MSGT_AO,MSGL_V,"alsa-spdif-init: playing AC3, %i channels\n", channels);
- device_set = 1;
break;
case 4:
strncpy(alsa_device, "surround40", ALSA_DEVICE_SIZE);
- device_set = 1;
break;
case 6:
strncpy(alsa_device, "surround51", ALSA_DEVICE_SIZE);
- device_set = 1;
break;
default:
mp_msg(MSGT_AO,MSGL_ERR,"alsa-spdif-init: %d channels are not supported\n", channels);
}
}
+ else
- if (!device_set)
{
int tmp_device, tmp_subdevice, err;
@@ -474,6 +472,7 @@ static int init(int rate_hz, int channels, int format, int flags)
}
mp_msg(MSGT_AO,MSGL_INFO,"alsa-init: %d soundcard%s found, using: %s\n", cards+1,(cards >= 0) ? "" : "s", alsa_device);
+ }
} else {
mp_msg(MSGT_AO,MSGL_INFO,"alsa-init: soundcard set to %s\n", alsa_device);
}