ext/alsa/gstalsa.c: Don't omit the last (which incase of dmix is the only :) ) channe...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Fri, 26 Nov 2004 11:47:24 +0000 (11:47 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Fri, 26 Nov 2004 11:47:24 +0000 (11:47 +0000)
Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_get_caps):
Don't omit the last (which incase of dmix is the only :) )
channel count. Don't set channels if <= 2.

ChangeLog
ext/alsa/gstalsa.c

index fc211b5..e6ae37e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-11-26  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * ext/alsa/gstalsa.c: (gst_alsa_get_caps):
+         Don't omit the last (which incase of dmix is the only :) )
+         channel count. Don't set channels if <= 2.
+
 2004-11-26  Christophe Fergeau  <teuf@gnome.org>
 
        * gst/playback/gstplaybin.c: (gen_video_element),
index fa51193..7ff42c8 100644 (file)
@@ -861,7 +861,7 @@ gst_alsa_get_caps (GstPad * pad)
             min_channels, max_channels);
 
         /* channel configuration */
-        for (n = min_channels; n < max_channels; n++) {
+        for (n = min_channels; n <= max_channels; n++) {
           if (snd_pcm_hw_params_test_channels (this->handle, hw_params, n) == 0) {
             GstStructure *str;
             GstAudioChannelPosition pos[8] = {
@@ -894,7 +894,9 @@ gst_alsa_get_caps (GstPad * pad)
             if (pos[0] != GST_AUDIO_CHANNEL_POSITION_INVALID) {
               str = gst_structure_copy (gst_caps_get_structure (caps, 0));
               gst_structure_set (str, "channels", G_TYPE_INT, n, NULL);
-              gst_audio_set_channel_positions (str, pos);
+              if (n > 2) {
+                gst_audio_set_channel_positions (str, pos);
+              }
               if (!ret) {
                 ret = gst_caps_new_empty ();
               }