changeset 35443:f045a1d92c06

Make AF_FORMAT_IS_IEC61937 include AF_FORMAT_IS_AC3. Our AC3 "sample format" is also iec61937.
author reimar
date Fri, 30 Nov 2012 20:10:40 +0000
parents 2b45dfcde03c
children 4644c320daf4
files libaf/af_format.h libao2/ao_alsa.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af_format.h	Fri Nov 30 20:08:29 2012 +0000
+++ b/libaf/af_format.h	Fri Nov 30 20:10:40 2012 +0000
@@ -115,7 +115,7 @@
 #define AF_FORMAT_UNKNOWN (-1)
 
 #define AF_FORMAT_IS_AC3(fmt) (((fmt) & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_AC3)
-#define AF_FORMAT_IS_IEC61937(fmt) (((fmt) & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_IEC61937)
+#define AF_FORMAT_IS_IEC61937(fmt) (AF_FORMAT_IS_AC3(fmt) || ((fmt) & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_IEC61937)
 
 int af_str2fmt(const char *str);
 int af_str2fmt_short(const char *str);
--- a/libao2/ao_alsa.c	Fri Nov 30 20:08:29 2012 +0000
+++ b/libao2/ao_alsa.c	Fri Nov 30 20:10:40 2012 +0000
@@ -111,7 +111,7 @@
       long get_vol, set_vol;
       float f_multi;
 
-      if(AF_FORMAT_IS_AC3(ao_data.format) || AF_FORMAT_IS_IEC61937(ao_data.format))
+      if(AF_FORMAT_IS_IEC61937(ao_data.format))
 	return CONTROL_TRUE;
 
       if(mixer_channel) {
@@ -410,7 +410,7 @@
      * while opening the abstract alias for the spdif subdevice
      * 'iec958'
      */
-    if (AF_FORMAT_IS_AC3(format) || AF_FORMAT_IS_IEC61937(format)) {
+    if (AF_FORMAT_IS_IEC61937(format)) {
 	device.str = "iec958";
 	mp_msg(MSGT_AO,MSGL_V,"alsa-spdif-init: playing AC3/iec61937/iec958, %i channels\n", channels);
     }
@@ -461,7 +461,7 @@
 
     if (!alsa_handler) {
       int open_mode = block ? 0 : SND_PCM_NONBLOCK;
-      int isac3 =  AF_FORMAT_IS_AC3(format) || AF_FORMAT_IS_IEC61937(format);
+      int isac3 =  AF_FORMAT_IS_IEC61937(format);
       //modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC
       mp_msg(MSGT_AO,MSGL_V,"alsa-init: opening device in %sblocking mode\n", block ? "" : "non-");
       if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0)