Commit 53e19e71 authored by Wim Taymans's avatar Wim Taymans
Browse files

pulse: trivial cleanups

parent 1e985802
......@@ -149,7 +149,7 @@ gst_pulsemixer_class_init (GstPulseMixerClass * g_class)
g_object_class_install_property (gobject_class,
PROP_DEVICE,
g_param_spec_string ("device", "Sink/Source",
g_param_spec_string ("device", "Device",
"The PulseAudio sink or source to control", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
......@@ -230,24 +230,18 @@ gst_pulsemixer_get_property (GObject * object,
case PROP_SERVER:
g_value_set_string (value, this->server);
break;
case PROP_DEVICE:
g_value_set_string (value, this->device);
break;
case PROP_DEVICE_NAME:
if (this->mixer) {
char *t = g_strdup_printf ("%s: %s",
this->mixer->type == GST_PULSEMIXER_SINK ? "Playback" : "Capture",
this->mixer->description);
g_value_set_string (value, t);
g_free (t);
g_value_take_string (value, t);
} else
g_value_set_string (value, NULL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -261,21 +255,16 @@ gst_pulsemixer_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
if (!this->mixer)
this->mixer =
gst_pulsemixer_ctrl_new (G_OBJECT (this), this->server,
this->device, GST_PULSEMIXER_UNKNOWN);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
if (this->mixer) {
gst_pulsemixer_ctrl_free (this->mixer);
this->mixer = NULL;
}
break;
default:
......
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