summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_pulse.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-10 00:49:13 +0100
committerwm4 <wm4@nowhere>2013-11-10 00:49:13 +0100
commit1a5c863a326f775d94dd995155d1d78448aef6d1 (patch)
tree5e6eefff5aa747dd5e1868888ba95a9c5d5105c0 /audio/out/ao_pulse.c
parent87ab30669c07ec4282cafb0f7ce86015a64b5cc0 (diff)
downloadmpv-1a5c863a326f775d94dd995155d1d78448aef6d1.tar.bz2
mpv-1a5c863a326f775d94dd995155d1d78448aef6d1.tar.xz
player: set PulseAudio stream title to window title
Set the PulseAudio stream title, just like the VO window title is set. Refactor update_vo_window_title() so that we can use it for AOs too. The ao_pulse.c bit is stolen from MPlayer.
Diffstat (limited to 'audio/out/ao_pulse.c')
-rw-r--r--audio/out/ao_pulse.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c
index 9d86cddd6d..a4da2a179b 100644
--- a/audio/out/ao_pulse.c
+++ b/audio/out/ao_pulse.c
@@ -582,6 +582,19 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
pa_threaded_mainloop_unlock(priv->mainloop);
return CONTROL_OK;
}
+
+ case AOCONTROL_UPDATE_STREAM_TITLE: {
+ char *title = (char *)arg;
+ pa_threaded_mainloop_lock(priv->mainloop);
+ if (!waitop(priv, pa_stream_set_name(priv->stream, title,
+ success_cb, ao)))
+ {
+ GENERIC_ERR_MSG("pa_stream_set_name() failed");
+ return CONTROL_ERROR;
+ }
+ return CONTROL_OK;
+ }
+
default:
return CONTROL_UNKNOWN;
}