Commit 0e5631c5 authored by Vineeth TM's avatar Vineeth TM Committed by Thiago Santos

interleave: error when channel-positions-from-input=False

self->channels is being incremented only when
channel-positions-from-input is set as TRUE. So in case of FALSE
self->func is not set and hence creating assertion error.
Hence removing the condition to increment self->channels.

https://bugzilla.gnome.org/show_bug.cgi?id=744211
parent 8f5bdf96
......@@ -453,7 +453,6 @@ gst_interleave_set_property (GObject * object, guint prop_id,
self->channel_positions = g_value_dup_boxed (value);
self->channel_positions_from_input = FALSE;
self->channels = self->channel_positions->n_values;
break;
case PROP_CHANNEL_POSITIONS_FROM_INPUT:
self->channel_positions_from_input = g_value_get_boolean (value);
......@@ -497,23 +496,23 @@ gst_interleave_request_new_pad (GstElement * element, GstPadTemplate * templ,
GstInterleave *self = GST_INTERLEAVE (element);
GstPad *new_pad;
gchar *pad_name;
gint channels, padnumber;
gint channel, padnumber;
GValue val = { 0, };
if (templ->direction != GST_PAD_SINK)
goto not_sink_pad;
padnumber = g_atomic_int_add (&self->padcounter, 1);
if (self->channel_positions_from_input)
channels = g_atomic_int_add (&self->channels, 1);
else
channels = padnumber;
channel = g_atomic_int_add (&self->channels, 1);
if (!self->channel_positions_from_input)
channel = padnumber;
pad_name = g_strdup_printf ("sink_%u", padnumber);
new_pad = GST_PAD_CAST (g_object_new (GST_TYPE_INTERLEAVE_PAD,
"name", pad_name, "direction", templ->direction,
"template", templ, NULL));
GST_INTERLEAVE_PAD_CAST (new_pad)->channel = channels;
GST_INTERLEAVE_PAD_CAST (new_pad)->channel = channel;
GST_DEBUG_OBJECT (self, "requested new pad %s", pad_name);
g_free (pad_name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment