[0.11] gst-plugins-base: alsa: merge instead of appending structures

Wim Taymans wtay at kemper.freedesktop.org
Thu Jan 26 05:29:00 PST 2012


Module: gst-plugins-base
Branch: 0.11
Commit: 61a53092e401a782af4e6e27323bfc5d2217ea23
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=61a53092e401a782af4e6e27323bfc5d2217ea23

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Jan 26 14:28:06 2012 +0100

alsa: merge instead of appending structures

---

 ext/alsa/gstalsa.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c
index 8da665b..12db49a 100644
--- a/ext/alsa/gstalsa.c
+++ b/ext/alsa/gstalsa.c
@@ -138,7 +138,7 @@ add_format (const gchar * str, GstStructure * s, snd_pcm_format_mask_t * mask,
     scopy = NULL;
   }
   if (scopy) {
-    gst_caps_append_structure (caps, scopy);
+    gst_caps_merge_structure (caps, scopy);
   }
 }
 
@@ -221,7 +221,7 @@ caps_add_channel_configuration (GstCaps * caps,
   if (min_chans == max_chans && max_chans == 1) {
     s = get_channel_free_structure (in_structure);
     gst_structure_set (s, "channels", G_TYPE_INT, 1, NULL);
-    gst_caps_append_structure (caps, s);
+    gst_caps_merge_structure (caps, s);
     return;
   }
 
@@ -232,15 +232,15 @@ caps_add_channel_configuration (GstCaps * caps,
     s = get_channel_free_structure (in_structure);
     gst_structure_set (s, "channels", G_TYPE_INT, 2, "channel-mask",
         GST_TYPE_BITMASK, CHANNEL_MASK_STEREO, NULL);
-    gst_caps_append_structure (caps, s);
+    gst_caps_merge_structure (caps, s);
   } else if (min_chans == 1 && max_chans >= 2) {
     s = get_channel_free_structure (in_structure);
     gst_structure_set (s, "channels", G_TYPE_INT, 2, "channel-mask",
         GST_TYPE_BITMASK, CHANNEL_MASK_STEREO, NULL);
-    gst_caps_append_structure (caps, s);
+    gst_caps_merge_structure (caps, s);
     s = get_channel_free_structure (in_structure);
     gst_structure_set (s, "channels", G_TYPE_INT, 1, NULL);
-    gst_caps_append_structure (caps, s);
+    gst_caps_merge_structure (caps, s);
   }
 
   /* don't know whether to use 2.1 or 3.0 here - but I suspect
@@ -250,7 +250,7 @@ caps_add_channel_configuration (GstCaps * caps,
     s = get_channel_free_structure (in_structure);
     gst_structure_set (s, "channels", G_TYPE_INT, 3, "channel-mask",
         GST_TYPE_BITMASK, CHANNEL_MASK_2_1, NULL);
-    gst_caps_append_structure (caps, s);
+    gst_caps_merge_structure (caps, s);
   }
 
   /* everything else (4, 6, 8 channels) needs a channel layout */
@@ -275,7 +275,7 @@ caps_add_channel_configuration (GstCaps * caps,
       }
       gst_structure_set (s, "channels", G_TYPE_INT, c, "channel-mask",
           GST_TYPE_BITMASK, channel_mask, NULL);
-      gst_caps_append_structure (caps, s);
+      gst_caps_merge_structure (caps, s);
     }
   }
 
@@ -284,7 +284,7 @@ caps_add_channel_configuration (GstCaps * caps,
     s = get_channel_free_structure (in_structure);
     gst_structure_set (s, "channels", G_TYPE_INT, c, "channel-mask",
         GST_TYPE_BITMASK, G_GUINT64_CONSTANT (0), NULL);
-    gst_caps_append_structure (caps, s);
+    gst_caps_merge_structure (caps, s);
   }
 }
 



More information about the gstreamer-commits mailing list