From 9e572ebf0065421567134e942d24ae26f0cee55d Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Wed, 13 Aug 2008 12:34:13 +0000 Subject: ext/pulse/: Improve debugging a bit by including the parent object in pulsemixerctrl and pulseprobe objects and using... Original commit message from CVS: * ext/pulse/pulsemixer.c: (gst_pulsemixer_change_state): * ext/pulse/pulsemixerctrl.c: (gst_pulsemixer_ctrl_subscribe_cb), (gst_pulsemixer_ctrl_open), (gst_pulsemixer_ctrl_new), (gst_pulsemixer_ctrl_free), (gst_pulsemixer_ctrl_timeout_event): * ext/pulse/pulsemixerctrl.h: * ext/pulse/pulseprobe.c: (gst_pulseprobe_open), (gst_pulseprobe_enumerate), (gst_pulseprobe_new), (gst_pulseprobe_free), (gst_pulseprobe_needs_probe), (gst_pulseprobe_probe_property), (gst_pulseprobe_get_values): * ext/pulse/pulseprobe.h: * ext/pulse/pulsesink.c: (gst_pulsesink_init): * ext/pulse/pulsesrc.c: (gst_pulsesrc_init), (gst_pulsesrc_delay), (gst_pulsesrc_change_state): Improve debugging a bit by including the parent object in pulsemixerctrl and pulseprobe objects and using GST_WARNING_OBJECT instead of GST_WARNING. Use the parent GObject subclass instead of a random struct as GObject parameter for G_OBJECT_WARN_INVALID_PROPERTY_ID. This fixes a crash when probing for another property than "device". --- ext/pulse/pulsesrc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ext/pulse/pulsesrc.c') diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c index e270c430..23597481 100644 --- a/ext/pulse/pulsesrc.c +++ b/ext/pulse/pulsesrc.c @@ -259,7 +259,7 @@ gst_pulsesrc_init (GTypeInstance * instance, gpointer g_class) pulsesrc->mixer = NULL; - pulsesrc->probe = gst_pulseprobe_new (G_OBJECT_GET_CLASS (pulsesrc), PROP_DEVICE, pulsesrc->device, FALSE, TRUE); /* FALSE for sinks, TRUE for sources */ + pulsesrc->probe = gst_pulseprobe_new (G_OBJECT (pulsesrc), G_OBJECT_GET_CLASS (pulsesrc), PROP_DEVICE, pulsesrc->device, FALSE, TRUE); /* FALSE for sinks, TRUE for sources */ } static void @@ -493,8 +493,9 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec) if (!pulsesrc->context || pa_context_get_state (pulsesrc->context) != PA_CONTEXT_READY) { GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, ("Bad context state: %s", - pulsesrc->context ? pa_strerror (pa_context_errno (pulsesrc-> - context)) : NULL), (NULL)); + pulsesrc-> + context ? pa_strerror (pa_context_errno (pulsesrc->context)) : + NULL), (NULL)); goto unlock_and_fail; } @@ -666,7 +667,7 @@ gst_pulsesrc_delay (GstAudioSrc * asrc) goto unlock_and_fail; } - GST_WARNING ("Not data while querying latency"); + GST_WARNING_OBJECT (pulsesrc, "Not data while querying latency"); t = 0; } else if (negative) t = 0; @@ -691,8 +692,8 @@ gst_pulsesrc_change_state (GstElement * element, GstStateChange transition) if (!this->mixer) this->mixer = - gst_pulsemixer_ctrl_new (this->server, this->device, - GST_PULSEMIXER_SOURCE); + gst_pulsemixer_ctrl_new (G_OBJECT (this), this->server, + this->device, GST_PULSEMIXER_SOURCE); break; -- cgit