# HG changeset patch # User reimar # Date 1379840610 0 # Node ID 99708d402208778d6004b034b0510b3b12fa6841 # Parent 0caa0bf428b9932d26f5042d72baea76aa01a9b2 Pass playing filename to audio outputs. Use it in pulseaudio to set the stream name. diff -r 0caa0bf428b9 -r 99708d402208 libao2/ao_pulse.c --- a/libao2/ao_pulse.c Sun Sep 22 08:34:08 2013 +0000 +++ b/libao2/ao_pulse.c Sun Sep 22 09:03:30 2013 +0000 @@ -379,6 +379,13 @@ static int control(int cmd, void *arg) { switch (cmd) { + case AOCONTROL_FILENAME: + pa_threaded_mainloop_lock(mainloop); + if (!waitop(pa_stream_set_name(stream, arg, success_cb, NULL))) { + GENERIC_ERR_MSG(context, "pa_stream_set_name() failed"); + return CONTROL_ERROR; + } + return CONTROL_OK; case AOCONTROL_GET_VOLUME: { ao_control_vol_t *vol = arg; uint32_t devidx = pa_stream_get_index(stream); diff -r 0caa0bf428b9 -r 99708d402208 libao2/audio_out.h --- a/libao2/audio_out.h Sun Sep 22 08:34:08 2013 +0000 +++ b/libao2/audio_out.h Sun Sep 22 09:03:30 2013 +0000 @@ -82,6 +82,7 @@ #define AOCONTROL_SET_VOLUME 5 #define AOCONTROL_SET_PLUGIN_DRIVER 6 #define AOCONTROL_SET_PLUGIN_LIST 7 +#define AOCONTROL_FILENAME 8 #define AOPLAY_FINAL_CHUNK 1 diff -r 0caa0bf428b9 -r 99708d402208 mplayer.c --- a/mplayer.c Sun Sep 22 08:34:08 2013 +0000 +++ b/mplayer.c Sun Sep 22 09:03:30 2013 +0000 @@ -3648,6 +3648,8 @@ reinit_audio_chain(); if (mpctx->sh_audio && mpctx->sh_audio->codec) mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_CODEC=%s\n", mpctx->sh_audio->codec->name); + if (mpctx->audio_out) + mpctx->audio_out->control(AOCONTROL_FILENAME, (void *)mp_basename(filename)); } current_module = "av_init";