Commit 92ed8f6a authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Don't use declarations after statements and variable length arrays.

Original commit message from CVS:
* ext/raw1394/gstdv1394src.c: (gst_dv1394src_uri_set_uri):
* ext/speex/gstspeexenc.c: (gst_speex_enc_sink_getcaps):
* ext/wavpack/gstwavpackenc.c: (gst_wavpack_enc_set_wp_config):
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_fixate):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format):
* tests/examples/equalizer/demo.c: (message_handler):
* tests/examples/spectrum/demo-audiotest.c: (message_handler):
* tests/examples/spectrum/demo-osssrc.c: (message_handler):
Don't use declarations after statements and variable length arrays.
parent 23078b43
2008-07-08 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* ext/raw1394/gstdv1394src.c: (gst_dv1394src_uri_set_uri):
* ext/speex/gstspeexenc.c: (gst_speex_enc_sink_getcaps):
* ext/wavpack/gstwavpackenc.c: (gst_wavpack_enc_set_wp_config):
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_fixate):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format):
* tests/examples/equalizer/demo.c: (message_handler):
* tests/examples/spectrum/demo-audiotest.c: (message_handler):
* tests/examples/spectrum/demo-osssrc.c: (message_handler):
Don't use declarations after statements and variable length arrays.
2008-07-07 Sebastian Dröge <sebastian.droege@collabora.co.uk>
Patch by: Daniel Drake <dsd at gentoo dot org>
......
common @ 79ade7b9
Subproject commit 593bb114c6f5c32b529aa6443be4c2d60d6484c7
Subproject commit 79ade7b9c9bf47eee491ceee4cf3ea116140ad35
......@@ -1146,6 +1146,7 @@ gst_dv1394src_uri_get_type (void)
{
return GST_URI_SRC;
}
static gchar **
gst_dv1394src_uri_get_protocols (void)
{
......@@ -1153,6 +1154,7 @@ gst_dv1394src_uri_get_protocols (void)
return protocols;
}
static const gchar *
gst_dv1394src_uri_get_uri (GstURIHandler * handler)
{
......@@ -1165,10 +1167,7 @@ static gboolean
gst_dv1394src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
{
gchar *protocol, *location;
gboolean ret;
ret = TRUE;
gboolean ret = TRUE;
GstDV1394Src *gst_dv1394src = GST_DV1394SRC (handler);
protocol = gst_uri_get_protocol (uri);
......
......@@ -259,7 +259,7 @@ gst_speex_enc_sink_getcaps (GstPad * pad)
if (peercaps) {
if (!gst_caps_is_empty (peercaps) && !gst_caps_is_any (peercaps)) {
GstStructure *ps = gst_caps_get_structure (peercaps, 0);
GstStructure *s = gst_caps_get_structure (caps, 0);;
GstStructure *s = gst_caps_get_structure (caps, 0);
gint rate, channels;
if (gst_structure_get_int (ps, "rate", &rate)) {
......
......@@ -475,13 +475,13 @@ gst_wavpack_enc_set_wp_config (GstWavpackEnc * enc)
/* Correction Mode, only in lossy mode */
if (enc->wp_config->flags & CONFIG_HYBRID_FLAG) {
if (enc->correction_mode > GST_WAVPACK_CORRECTION_MODE_OFF) {
GstCaps *caps = gst_caps_new_simple ("audio/x-wavpack-correction",
"framed", G_TYPE_BOOLEAN, TRUE, NULL);
enc->wvcsrcpad =
gst_pad_new_from_static_template (&wvcsrc_factory, "wvcsrc");
/* try to add correction src pad, don't set correction mode on failure */
GstCaps *caps = gst_caps_new_simple ("audio/x-wavpack-correction",
"framed", G_TYPE_BOOLEAN, TRUE, NULL);
GST_DEBUG_OBJECT (enc, "Adding correction pad with caps %"
GST_PTR_FORMAT, caps);
if (!gst_pad_set_caps (enc->wvcsrcpad, caps)) {
......@@ -546,8 +546,8 @@ gst_wavpack_enc_push_block (void *id, void *data, int32_t count)
pad = (wid->correction) ? enc->wvcsrcpad : enc->srcpad;
flow =
(wid->correction) ? &enc->wvcsrcpad_last_return : &enc->
srcpad_last_return;
(wid->correction) ? &enc->
wvcsrcpad_last_return : &enc->srcpad_last_return;
*flow = gst_pad_alloc_buffer_and_set_caps (pad, GST_BUFFER_OFFSET_NONE,
count, GST_PAD_CAPS (pad), &buffer);
......
......@@ -424,9 +424,10 @@ gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps)
GST_DEBUG_OBJECT (basesrc, "fixating caps %" GST_PTR_FORMAT, caps);
for (i = 0; i < gst_caps_get_size (caps); ++i) {
structure = gst_caps_get_structure (caps, i);
const GValue *v;
structure = gst_caps_get_structure (caps, i);
/* FIXME such sizes? we usually fixate to something in the 320x200
* range... */
/* We are fixating to greater possble size (limited to GST_V4L2_MAX_SIZE)
......
......@@ -757,11 +757,9 @@ GstCaps *
gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat,
const GstStructure * template)
{
GstCaps *ret;
GstCaps *ret = gst_caps_new_empty ();
GstStructure *tmp;
ret = gst_caps_new_empty ();
#ifdef VIDIOC_ENUM_FRAMESIZES
gint fd = v4l2src->v4l2object->video_fd;
struct v4l2_frmsizeenum size;
......
......@@ -102,7 +102,7 @@ message_handler (GstBus * bus, GstMessage * message, gpointer data)
const gchar *name = gst_structure_get_name (s);
if (strcmp (name, "spectrum") == 0) {
gfloat spect[spect_bands];
gfloat *spect = g_new (gfloat, spect_bands);
const GValue *list;
const GValue *value;
guint i;
......@@ -113,6 +113,7 @@ message_handler (GstBus * bus, GstMessage * message, gpointer data)
spect[i] = height_scale * g_value_get_float (value);
}
draw_spectrum (spect);
g_free (spect);
}
}
return TRUE;
......
......@@ -98,7 +98,7 @@ message_handler (GstBus * bus, GstMessage * message, gpointer data)
const gchar *name = gst_structure_get_name (s);
if (strcmp (name, "spectrum") == 0) {
gfloat spect[spect_bands];
gfloat *spect = g_new (gfloat, spect_bands);
const GValue *list;
const GValue *value;
guint i;
......@@ -109,6 +109,7 @@ message_handler (GstBus * bus, GstMessage * message, gpointer data)
spect[i] = height_scale * g_value_get_float (value);
}
draw_spectrum (spect);
g_free (spect);
}
}
return TRUE;
......
......@@ -88,7 +88,7 @@ message_handler (GstBus * bus, GstMessage * message, gpointer data)
const gchar *name = gst_structure_get_name (s);
if (strcmp (name, "spectrum") == 0) {
gfloat spect[spect_bands];
gfloat *spect = g_new (gfloat, spect_bands);
const GValue *list;
const GValue *value;
guint i;
......@@ -99,6 +99,7 @@ message_handler (GstBus * bus, GstMessage * message, gpointer data)
spect[i] = height_scale * g_value_get_float (value);
}
draw_spectrum (spect);
g_free (spect);
}
}
return TRUE;
......
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