summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2007-10-10 11:44:01 +0000
committerTim-Philipp Müller <tim@centricular.net>2007-10-10 11:44:01 +0000
commitbb6c23aa436744475e48448dce389863c0b049a4 (patch)
tree395bb7f29605075098755fb1fbcc98610b630422 /ext
parentd73a5f3250bca1e85028a74c8c35c081e1ef677f (diff)
downloadgstreamer-plugins-bad-bb6c23aa436744475e48448dce389863c0b049a4.tar.gz
configure.ac: Require core CVS. This is implicit in the -base CVS requirement already, so we might just well spell i...
Original commit message from CVS: * configure.ac: Require core CVS. This is implicit in the -base CVS requirement already, so we might just well spell it out. Also, we do need at least 0.10.14 for gst_element_class_set_details_simple(). Make check for gmyth a bit more restrictive so things don't break if the next version changes API. * ext/alsaspdif/alsaspdifsink.c: Work around alsa alloca macros triggering 'always evaluates to true' warnings with gcc-4.2 and fix compilation with gcc-4.2. Also don't leak the device string. * ext/mpeg2enc/gstmpeg2enc.cc: * ext/soundtouch/gstpitch.cc: * gst/modplug/gstmodplug.cc: Fix compilation with g++4.2 and -Wall -Werror (also needs plugin define fix from core CVS). Fixes #462737.
Diffstat (limited to 'ext')
-rw-r--r--ext/alsaspdif/alsaspdifsink.c40
-rw-r--r--ext/mpeg2enc/gstmpeg2enc.cc13
-rw-r--r--ext/soundtouch/gstpitch.cc17
3 files changed, 40 insertions, 30 deletions
diff --git a/ext/alsaspdif/alsaspdifsink.c b/ext/alsaspdif/alsaspdifsink.c
index bc1e22760..bea75bf97 100644
--- a/ext/alsaspdif/alsaspdifsink.c
+++ b/ext/alsaspdif/alsaspdifsink.c
@@ -122,6 +122,7 @@ static GstClock *alsaspdifsink_provide_clock (GstElement * elem);
static GstClockTime alsaspdifsink_get_time (GstClock * clock,
gpointer user_data);
static void alsaspdifsink_dispose (GObject * object);
+static void alsaspdifsink_finalize (GObject * object);
static GstStateChangeReturn alsaspdifsink_change_state (GstElement * element,
GstStateChange transition);
@@ -155,6 +156,7 @@ alsaspdifsink_class_init (AlsaSPDIFSinkClass * klass)
gobject_class->set_property = alsaspdifsink_set_property;
gobject_class->get_property = alsaspdifsink_get_property;
gobject_class->dispose = alsaspdifsink_dispose;
+ gobject_class->finalize = alsaspdifsink_finalize;
gstelement_class->change_state = alsaspdifsink_change_state;
gstelement_class->provide_clock = alsaspdifsink_provide_clock;
@@ -205,6 +207,17 @@ alsaspdifsink_dispose (GObject * object)
}
static void
+alsaspdifsink_finalize (GObject * object)
+{
+ AlsaSPDIFSink *sink = ALSASPDIFSINK (object);
+
+ g_free (sink->device);
+ sink->device = NULL;
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
alsaspdifsink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
@@ -293,9 +306,6 @@ alsaspdifsink_open (AlsaSPDIFSink * sink)
char devstr[256]; /* Storage for local 'default' device string */
GstClockTime time;
- snd_pcm_hw_params_alloca (&params);
- snd_pcm_sw_params_alloca (&sw_params);
-
/*
* Try and open our default iec958 device. Fall back to searching on card x
* if this fails, which should only happen on older alsa setups
@@ -336,6 +346,9 @@ alsaspdifsink_open (AlsaSPDIFSink * sink)
return FALSE;
}
+ snd_pcm_hw_params_malloc (&params);
+ snd_pcm_sw_params_malloc (&sw_params);
+
err = snd_pcm_hw_params_any (sink->pcm, params);
if (err < 0) {
GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE,
@@ -447,9 +460,13 @@ alsaspdifsink_open (AlsaSPDIFSink * sink)
snd_pcm_sw_params_get_avail_min (sw_params, &avail_min);
GST_DEBUG_OBJECT (sink, "Avail min set to:%lu frames", avail_min);
+ snd_pcm_hw_params_free (params);
+ snd_pcm_sw_params_free (sw_params);
return TRUE;
__close:
+ snd_pcm_hw_params_free (params);
+ snd_pcm_sw_params_free (sw_params);
snd_pcm_close (sink->pcm);
sink->pcm = NULL;
return FALSE;
@@ -488,14 +505,14 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink)
GST_WARNING ("Opening IEC958 named device failed. Trying to autodetect");
- snd_ctl_card_info_alloca (&info);
- snd_pcm_info_alloca (&pinfo);
-
if ((err = snd_ctl_open (&ctl, ctl_name, card)) < 0)
return err;
+ snd_ctl_card_info_malloc (&info);
+ snd_pcm_info_malloc (&pinfo);
+
/* Find a mixer for IEC958 settings */
- snd_ctl_elem_list_alloca (&clist);
+ snd_ctl_elem_list_malloc (&clist);
if ((err = snd_ctl_elem_list (ctl, clist)) < 0)
goto beach;
@@ -516,7 +533,7 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink)
err = 0;
goto beach;
}
- snd_ctl_elem_id_alloca (&cid);
+ snd_ctl_elem_id_malloc (&cid);
snd_ctl_elem_list_get_id (clist, idx, cid);
/* Now find a PCM device for IEC 958 */
@@ -572,7 +589,7 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink)
snd_aes_iec958_t iec958;
/* Have a PCM device and a mixer, set things up */
- snd_ctl_elem_value_alloca (&cval);
+ snd_ctl_elem_value_malloc (&cval);
snd_ctl_elem_value_set_id (cval, cid);
snd_ctl_elem_value_get_iec958 (cval, &iec958);
iec958.status[0] = IEC958_AES0_NONAUDIO;
@@ -580,6 +597,7 @@ alsaspdifsink_find_pcm_device (AlsaSPDIFSink * sink)
iec958.status[2] = 0;
iec958.status[3] = IEC958_AES3_CON_FS_48000;
snd_ctl_elem_value_set_iec958 (cval, &iec958);
+ snd_ctl_elem_value_free (cval);
sink->pcm = pcm;
pcm = NULL;
@@ -591,6 +609,10 @@ beach:
snd_pcm_close (pcm);
snd_ctl_elem_list_clear (clist);
snd_ctl_close (ctl);
+ snd_ctl_elem_list_free (clist);
+ snd_ctl_elem_id_free (cid);
+ snd_ctl_card_info_free (info);
+ snd_pcm_info_free (pinfo);
return err;
}
diff --git a/ext/mpeg2enc/gstmpeg2enc.cc b/ext/mpeg2enc/gstmpeg2enc.cc
index b91d94265..6ba9cde9e 100644
--- a/ext/mpeg2enc/gstmpeg2enc.cc
+++ b/ext/mpeg2enc/gstmpeg2enc.cc
@@ -69,13 +69,6 @@
GST_DEBUG_CATEGORY (mpeg2enc_debug);
-static GstElementDetails gst_mpeg2enc_details =
-GST_ELEMENT_DETAILS ("mpeg2enc video encoder",
- "Codec/Encoder/Video",
- "High-quality MPEG-1/2 video encoder",
- "Andrew Stevens <andrew.stevens@nexgo.de>\n"
- "Ronald Bultje <rbultje@ronald.bitfreak.net>");
-
#define COMMON_VIDEO_CAPS \
"width = (int) [ 16, 4096 ], " \
"height = (int) [ 16, 4096 ], " \
@@ -121,7 +114,11 @@ gst_mpeg2enc_base_init (gpointer klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
- gst_element_class_set_details (element_class, &gst_mpeg2enc_details);
+ gst_element_class_set_details_simple (element_class,
+ "mpeg2enc video encoder", "Codec/Encoder/Video",
+ "High-quality MPEG-1/2 video encoder",
+ "Andrew Stevens <andrew.stevens@nexgo.de>\n"
+ "Ronald Bultje <rbultje@ronald.bitfreak.net>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_template));
diff --git a/ext/soundtouch/gstpitch.cc b/ext/soundtouch/gstpitch.cc
index da90c5135..b1a019f2b 100644
--- a/ext/soundtouch/gstpitch.cc
+++ b/ext/soundtouch/gstpitch.cc
@@ -47,23 +47,12 @@ struct _GstPitchPrivate
soundtouch::SoundTouch * st;
};
-static GstElementDetails gst_pitch_details =
-GST_ELEMENT_DETAILS ("Pitch controller",
- "Filter/Converter/Audio",
- "Control the pitch of an audio stream",
- "Wouter Paesen <wouter@kangaroot.net>");
-
-enum
-{
- LAST_SIGNAL
-};
-
enum
{
ARG_0,
ARG_RATE,
ARG_TEMPO,
- ARG_PITCH,
+ ARG_PITCH
};
#define SUPPORTED_CAPS \
@@ -117,7 +106,9 @@ gst_pitch_base_init (gpointer g_class)
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_pitch_sink_template));
- gst_element_class_set_details (gstelement_class, &gst_pitch_details);
+ gst_element_class_set_details_simple (gstelement_class, "Pitch controller",
+ "Filter/Converter/Audio", "Control the pitch of an audio stream",
+ "Wouter Paesen <wouter@kangaroot.net>");
}
static void