From: <ds...@ke...> - 2007-09-16 01:56:32
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: ds Date: Sun Sep 16 2007 01:56:36 UTC Log message: * ext/alsa/gstalsa.c: * ext/alsa/gstalsadeviceprobe.c: * ext/alsa/gstalsamixer.c: * ext/alsa/gstalsasink.c: * ext/alsa/gstalsasrc.c: Change alsa alloca's to malloc to fix warnings on gcc-4.2. Modified files: . : ChangeLog ext/alsa : gstalsa.c gstalsadeviceprobe.c gstalsamixer.c gstalsasink.c gstalsasrc.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.3514&r2=1.3515 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/alsa/gstalsa.c.diff?r1=1.147&r2=1.148 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c.diff?r1=1.3&r2=1.4 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/alsa/gstalsamixer.c.diff?r1=1.38&r2=1.39 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/alsa/gstalsasink.c.diff?r1=1.85&r2=1.86 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/alsa/gstalsasrc.c.diff?r1=1.43&r2=1.44 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.3514 retrieving revision 1.3515 diff -u -d -r1.3514 -r1.3515 --- ChangeLog 15 Sep 2007 18:41:09 -0000 1.3514 +++ ChangeLog 16 Sep 2007 01:56:19 -0000 1.3515 @@ -1,3 +1,12 @@ +2007-09-15 David Schleef <ds...@sc...> + + * ext/alsa/gstalsa.c: + * ext/alsa/gstalsadeviceprobe.c: + * ext/alsa/gstalsamixer.c: + * ext/alsa/gstalsasink.c: + * ext/alsa/gstalsasrc.c: + Change alsa alloca's to malloc to fix warnings on gcc-4.2. 2007-09-15 Wim Taymans <wim...@gm...> * gst-libs/gst/rtp/gstbasertppayload.c: Index: gstalsa.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsa.c,v retrieving revision 1.147 retrieving revision 1.148 diff -u -d -r1.147 -r1.148 --- gstalsa.c 29 Aug 2007 14:22:04 -0000 1.147 +++ gstalsa.c 16 Sep 2007 01:56:21 -0000 1.148 @@ -110,7 +110,7 @@ GstCaps *caps; gint i; - snd_pcm_format_mask_alloca (&mask); + snd_pcm_format_mask_malloc (&mask); snd_pcm_hw_params_get_format_mask (hw_params, mask); caps = gst_caps_new_empty (); @@ -157,6 +157,7 @@ } } + snd_pcm_format_mask_free (mask); gst_caps_unref (in_caps); return caps; } @@ -375,7 +376,7 @@ gint err; - snd_pcm_hw_params_alloca (&hw_params); + snd_pcm_hw_params_malloc (&hw_params); if ((err = snd_pcm_hw_params_any (handle, hw_params)) < 0) goto error; @@ -390,17 +391,20 @@ if (!(caps = gst_alsa_detect_channels (obj, hw_params, caps))) goto subroutine_error; + snd_pcm_hw_params_free (hw_params); /* ERRORS */ error: { GST_ERROR_OBJECT (obj, "failed to query formats: %s", snd_strerror (err)); + snd_pcm_hw_params_free (hw_params); return NULL; subroutine_error: GST_ERROR_OBJECT (obj, "failed to query formats"); Index: gstalsadeviceprobe.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gstalsadeviceprobe.c 5 Oct 2006 15:55:19 -0000 1.3 +++ gstalsadeviceprobe.c 16 Sep 2007 01:56:21 -0000 1.4 @@ -61,8 +61,8 @@ if (stream == -1) stream = 0; - snd_ctl_card_info_alloca (&info); - snd_pcm_info_alloca (&pcminfo); + snd_ctl_card_info_malloc (&info); + snd_pcm_info_malloc (&pcminfo); card = -1; if (snd_card_next (&card) < 0 || card < 0) { @@ -111,6 +111,9 @@ + snd_ctl_card_info_free (info); + snd_pcm_info_free (pcminfo); return list; Index: gstalsamixer.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsamixer.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- gstalsamixer.c 21 Jul 2007 09:21:12 -0000 1.38 +++ gstalsamixer.c 16 Sep 2007 01:56:21 -0000 1.39 @@ -90,7 +90,7 @@ goto no_card_name; - snd_ctl_card_info_alloca (&card_info); + snd_ctl_card_info_malloc (&card_info); if ((err = snd_ctl_card_info (ctl, card_info)) < 0) { GST_WARNING ("Cannot get card info: %s", snd_strerror (err)); snd_ctl_close (ctl); @@ -99,6 +99,7 @@ mixer->cardname = g_strdup (snd_ctl_card_info_get_name (card_info)); GST_DEBUG ("Card name = %s", GST_STR_NULL (mixer->cardname)); + snd_ctl_card_info_free (card_info); snd_ctl_close (ctl); no_card_name: Index: gstalsasink.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsasink.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- gstalsasink.c 24 Aug 2007 15:28:32 -0000 1.85 +++ gstalsasink.c 16 Sep 2007 01:56:21 -0000 1.86 @@ -333,7 +333,7 @@ snd_pcm_hw_params_t *params; guint period_time, buffer_time; - snd_pcm_hw_params_alloca (¶ms); + snd_pcm_hw_params_malloc (¶ms); GST_DEBUG_OBJECT (alsa, "Negotiating to %d channels @ %d Hz (format = %s)", alsa->channels, alsa->rate, snd_pcm_format_name (alsa->format)); @@ -423,6 +423,7 @@ GST_DEBUG_OBJECT (alsa, "buffer size %lu, period size %lu", alsa->buffer_size, alsa->period_size); + snd_pcm_hw_params_free (params); return 0; @@ -431,18 +432,21 @@ GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL), ("Broken configuration for playback: no configurations available: %s", snd_strerror (err))); + snd_pcm_hw_params_free (params); return err; wrong_access: ("Access type not available for playback: %s", snd_strerror (err))); no_sample_format: ("Sample format not available for playback: %s", snd_strerror (err))); no_channels: @@ -460,6 +464,7 @@ alsa->channels); GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (msg), (snd_strerror (err))); g_free (msg); no_rate: @@ -473,24 +478,28 @@ ("Rate doesn't match (requested %iHz, get %iHz)", alsa->rate, err)); return -EINVAL; buffer_size: ("Unable to get buffer size for playback: %s", snd_strerror (err))); period_size: ("Unable to get period size for playback: %s", snd_strerror (err))); set_hw_params: ("Unable to set hw params for playback: %s", snd_strerror (err))); @@ -501,7 +510,7 @@ int err; snd_pcm_sw_params_t *params; - snd_pcm_sw_params_alloca (¶ms); + snd_pcm_sw_params_malloc (¶ms); /* get the current swparams */ CHECK (snd_pcm_sw_params_current (alsa->handle, params), no_config); @@ -520,6 +529,7 @@ /* write the parameters to the playback device */ CHECK (snd_pcm_sw_params (alsa->handle, params), set_sw_params); + snd_pcm_sw_params_free (params); @@ -528,6 +538,7 @@ ("Unable to determine current swparams for playback: %s", + snd_pcm_sw_params_free (params); start_threshold: @@ -535,24 +546,28 @@ ("Unable to set start threshold mode for playback: %s", set_avail: ("Unable to set avail min for playback: %s", snd_strerror (err))); set_align: ("Unable to set transfer align for playback: %s", snd_strerror (err))); set_sw_params: ("Unable to set sw params for playback: %s", snd_strerror (err))); Index: gstalsasrc.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsasrc.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- gstalsasrc.c 24 Aug 2007 15:28:33 -0000 1.43 +++ gstalsasrc.c 16 Sep 2007 01:56:21 -0000 1.44 @@ -348,7 +348,7 @@ gint err, dir; /* choose all parameters */ CHECK (snd_pcm_hw_params_any (alsa->handle, params), no_config); @@ -388,6 +388,7 @@ CHECK (snd_pcm_hw_params_get_period_size (params, &alsa->period_size, &dir), period_size); @@ -396,18 +397,21 @@ ("Broken configuration for recording: no configurations available: %s", ("Access type not available for recording: %s", snd_strerror (err))); ("Sample format not available for recording: %s", snd_strerror (err))); @@ -425,6 +429,7 @@ @@ -432,12 +437,14 @@ ("Rate %iHz not available for recording: %s", alsa->rate, snd_strerror (err))); rate_match: buffer_time: @@ -445,12 +452,14 @@ ("Unable to set buffer time %i for recording: %s", alsa->buffer_time, snd_strerror (err))); ("Unable to get buffer size for recording: %s", snd_strerror (err))); period_time: @@ -458,18 +467,21 @@ ("Unable to set period time %i for recording: %s", alsa->period_time, ("Unable to get period size for recording: %s", snd_strerror (err))); ("Unable to set hw params for recording: %s", snd_strerror (err))); @@ -480,7 +492,7 @@ @@ -496,6 +508,7 @@ /* write the parameters to the recording device */ @@ -504,6 +517,7 @@ @@ -511,24 +525,28 @@ |