From fe83843abeb9234f30bcf979c8f9e2c428caa2d0 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 14 Aug 2012 09:36:30 +0530 Subject: [PATCH] pulsesrc: Don't use memset to set invalid channel positions This itereates over the GstAudioInfo to set invalid channel positions rather than use memset() which works right now because it assumes that GST_AUDIO_CHANNEL_POSITION_INVALID is -1. --- ext/pulse/pulsesrc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c index 1b1acf2..d41010a 100644 --- a/ext/pulse/pulsesrc.c +++ b/ext/pulse/pulsesrc.c @@ -1144,6 +1144,7 @@ gst_pulsesrc_create_stream (GstPulseSrc * pulsesrc, GstCaps ** caps) gboolean need_channel_layout = FALSE; GstAudioRingBufferSpec spec; const gchar *name; + int i; s = gst_caps_get_structure (*caps, 0); gst_structure_get_int (s, "channels", &spec.info.channels); @@ -1175,7 +1176,8 @@ gst_pulsesrc_create_stream (GstPulseSrc * pulsesrc, GstCaps ** caps) need_channel_layout = TRUE; gst_structure_set (s, "channel-mask", GST_TYPE_BITMASK, G_GUINT64_CONSTANT (0), NULL); - memset (spec.info.position, 0xff, sizeof (spec.info.position)); + for (i = 0; i < G_N_ELEMENTS (spec.info.position); i++) + spec.info.position[i] = GST_AUDIO_CHANNEL_POSITION_INVALID; } if (!gst_pulse_fill_sample_spec (&spec, &pulsesrc->sample_spec)) -- 2.7.4