changeset 13661:07dc40f25068

Only use S/PDIF output when no other alsa device is set, allows to use external ac3 decoders.
author reimar
date Sun, 17 Oct 2004 20:03:55 +0000
parents b34c5aa5f798
children efa186bd32a9
files DOCS/man/en/mplayer.1 libao2/ao_alsa.c
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Sun Oct 17 19:32:47 2004 +0000
+++ b/DOCS/man/en/mplayer.1	Sun Oct 17 20:03:55 2004 +0000
@@ -1752,6 +1752,8 @@
 .IPs device=<device>
 Sets the device name.
 Replace any ',' with '.' and any ':' with '=' in the ALSA device name.
+Make sure you do not set this when you want hwac3 output via S/PDIF, unless
+you really know how to set it correctly.
 .RE
 .PD 1
 .
--- a/libao2/ao_alsa.c	Sun Oct 17 19:32:47 2004 +0000
+++ b/libao2/ao_alsa.c	Sun Oct 17 20:03:55 2004 +0000
@@ -405,6 +405,7 @@
         }
     }
 
+  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 @@
  		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 @@
 	  }
 
 	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);
       }