[xiph-commits] r18781 - in trunk/ao/src: . plugins/alsa

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Tue Jan 22 02:26:45 PST 2013


Author: xiphmont
Date: 2013-01-22 02:26:45 -0800 (Tue, 22 Jan 2013)
New Revision: 18781

Modified:
   trunk/ao/src/audio_out.c
   trunk/ao/src/plugins/alsa/ao_alsa.c
Log:
Remove Nch->stereo force for ALSA default device
enable swap buffer if driver backend changes output channel count


Modified: trunk/ao/src/audio_out.c
===================================================================
--- trunk/ao/src/audio_out.c	2013-01-22 08:25:17 UTC (rev 18780)
+++ trunk/ao/src/audio_out.c	2013-01-22 10:26:45 UTC (rev 18781)
@@ -1198,6 +1198,7 @@
 
 	if ( (device->bytewidth>1 &&
               device->client_byte_format != device->driver_byte_format) ||
+             device->input_channels != device->output_channels ||
              device->inter_permute){
 
           result = _realloc_swap_buffer(device, DEF_SWAP_BUF_SIZE);

Modified: trunk/ao/src/plugins/alsa/ao_alsa.c
===================================================================
--- trunk/ao/src/plugins/alsa/ao_alsa.c	2013-01-22 08:25:17 UTC (rev 18780)
+++ trunk/ao/src/plugins/alsa/ao_alsa.c	2013-01-22 10:26:45 UTC (rev 18781)
@@ -504,22 +504,6 @@
     return err;
   }
 
-  /* this is a hack and fragile if the exact device detection code
-     flow changes!  Nevertheless, this is a useful warning for users.
-     Never fail silently if we can help it! */
-  if(!strcasecmp(dev,"default")){
-    /* default device */
-    if(device->output_channels>2){
-      awarn("ALSA 'default' device plays only channels 0,1.\n");
-      device->output_channels=2;
-    }
-  }
-  if(!strcasecmp(dev,"default") || !strncasecmp(dev,"plug",4)){
-    if(format->bits>16){
-      awarn("ALSA '%s' device may only simulate >16 bit playback\n",dev);
-    }
-  }
-
   /* try to set up hw params */
   err = alsa_set_hwparams(device,format);
   if(err<0){
@@ -544,6 +528,21 @@
     return err;
   }
 
+  /* this is a hack and fragile if the exact device detection code
+     flow changes!  Nevertheless, this is a useful warning for users.
+     Never fail silently if we can help it! */
+  if(!strcasecmp(dev,"default")){
+    /* default device */
+    if(device->output_channels>2){
+      awarn("ALSA 'default' device plays only channels 0,1.\n");
+    }
+  }
+  if(!strcasecmp(dev,"default") || !strncasecmp(dev,"plug",4)){
+    if(format->bits>16){
+      awarn("ALSA '%s' device may only simulate >16 bit playback\n",dev);
+    }
+  }
+
   /* success! */
   return 0;
 }



More information about the commits mailing list