mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
pulse: trivial cleanups
This commit is contained in:
parent
1e98580204
commit
53e19e71f1
1 changed files with 2 additions and 13 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue