ext/alsa/: Fix ancient leftovers... MixerTrack is a GObject.

Original commit message from CVS:
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_free_list):
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_class_init),
(gst_alsa_mixer_track_new):
* ext/alsa/gstalsamixertrack.h:
Fix ancient leftovers... MixerTrack is a GObject.
This commit is contained in:
Ronald S. Bultje 2004-03-13 05:52:26 +00:00
parent f71358e5bd
commit 7b7b337d12
4 changed files with 11 additions and 26 deletions

View file

@ -1,3 +1,11 @@
2004-03-13 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_free_list):
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_class_init),
(gst_alsa_mixer_track_new):
* ext/alsa/gstalsamixertrack.h:
Fix ancient leftovers... MixerTrack is a GObject.
2004-03-13 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/alsa/gstalsa.c: (gst_alsa_class_probe_devices):

View file

@ -262,7 +262,7 @@ gst_alsa_mixer_free_list (GstAlsaMixer *mixer)
{
g_return_if_fail (((gint) mixer->mixer_handle) != -1);
g_list_foreach (mixer->tracklist, (GFunc) gst_alsa_mixer_track_free, NULL);
g_list_foreach (mixer->tracklist, (GFunc) g_object_unref, NULL);
g_list_free (mixer->tracklist);
mixer->tracklist = NULL;
}

View file

@ -24,7 +24,6 @@
#include "gstalsamixertrack.h"
static void gst_alsa_mixer_track_init (GstAlsaMixerTrack * alsa_track);
static void gst_alsa_mixer_track_dispose (GObject * object);
static void gst_alsa_mixer_track_class_init (gpointer g_class,
gpointer class_data);
@ -57,25 +56,14 @@ gst_alsa_mixer_track_get_type (void)
static void
gst_alsa_mixer_track_class_init (gpointer g_class, gpointer class_data)
{
GObjectClass *object_class = (GObjectClass *) g_class;
if (parent_class == NULL)
parent_class = g_type_class_ref (GST_TYPE_MIXER_TRACK);
object_class->dispose = gst_alsa_mixer_track_dispose;
}
static void
gst_alsa_mixer_track_init (GstAlsaMixerTrack *alsa_track)
{ }
static void
gst_alsa_mixer_track_dispose (GObject *object)
{
if (object != NULL)
gst_alsa_mixer_track_free (GST_ALSA_MIXER_TRACK (object));
}
GstMixerTrack *
gst_alsa_mixer_track_new (snd_mixer_elem_t *element,
gint track_num,
@ -85,7 +73,7 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t *element,
gint i;
long min, max;
GstMixerTrack *track = (GstMixerTrack *) g_new (GstAlsaMixerTrack, 1);
GstMixerTrack *track = g_object_new (GST_ALSA_MIXER_TRACK_TYPE, NULL);
GstAlsaMixerTrack *alsa_track = (GstAlsaMixerTrack *) track;
/* set basic information */
@ -117,14 +105,3 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t *element,
return track;
}
void
gst_alsa_mixer_track_free (GstAlsaMixerTrack *alsa_track)
{
if (alsa_track != NULL) {
g_free (GST_MIXER_TRACK (alsa_track)->label);
g_free (alsa_track);
}
}

View file

@ -24,6 +24,7 @@
G_BEGIN_DECLS
#define GST_ALSA_MIXER_TRACK_TYPE (gst_alsa_mixer_track_get_type ())
#define GST_ALSA_MIXER_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_MIXER_TRACK,GstAlsaMixerTrack))
#define GST_ALSA_MIXER_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_MIXER_TRACK,GstAlsaMixerTrackClass))
#define GST_IS_ALSA_MIXER_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_MIXER_TRACK))
@ -50,7 +51,6 @@ GstMixerTrack * gst_alsa_mixer_track_new (snd_mixer_elem_t * element,
gint track_num,
gint channels,
gint flags);
void gst_alsa_mixer_track_free (GstAlsaMixerTrack * alsa_track);
G_END_DECLS