[MPlayer-cvslog] r36458 - in trunk: libao2/ao_pulse.c libao2/audio_out.h mplayer.c
reimar
subversion at mplayerhq.hu
Sun Sep 22 11:03:30 CEST 2013
Author: reimar
Date: Sun Sep 22 11:03:30 2013
New Revision: 36458
Log:
Pass playing filename to audio outputs.
Use it in pulseaudio to set the stream name.
Modified:
trunk/libao2/ao_pulse.c
trunk/libao2/audio_out.h
trunk/mplayer.c
Modified: trunk/libao2/ao_pulse.c
==============================================================================
--- trunk/libao2/ao_pulse.c Sun Sep 22 10:34:08 2013 (r36457)
+++ trunk/libao2/ao_pulse.c Sun Sep 22 11:03:30 2013 (r36458)
@@ -379,6 +379,13 @@ static void info_func(struct pa_context
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);
Modified: trunk/libao2/audio_out.h
==============================================================================
--- trunk/libao2/audio_out.h Sun Sep 22 10:34:08 2013 (r36457)
+++ trunk/libao2/audio_out.h Sun Sep 22 11:03:30 2013 (r36458)
@@ -82,6 +82,7 @@ void mp_ao_resume_refill(const ao_functi
#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
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c Sun Sep 22 10:34:08 2013 (r36457)
+++ trunk/mplayer.c Sun Sep 22 11:03:30 2013 (r36458)
@@ -3648,6 +3648,8 @@ goto_enable_cache:
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";
More information about the MPlayer-cvslog
mailing list