diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao.c | 2 | ||||
-rw-r--r-- | audio/out/ao_pulse.c | 7 | ||||
-rw-r--r-- | audio/out/internal.h | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c index b94e459091..baf6db1e45 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -207,6 +207,8 @@ static struct ao *ao_alloc_pb(bool probing, struct mpv_global *global, match_ao_driver(ao->driver->name, opts->audio_device, &ao->device); ao->device = talloc_strdup(ao, ao->device); + ao->client_name = talloc_strdup(ao, opts->audio_client_name); + return ao; } diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index e1f339f20b..f9fe64d84d 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -35,8 +35,6 @@ #include "ao.h" #include "internal.h" -#define PULSE_CLIENT_NAME "mpv" - #define VOL_PA2MP(v) ((v) * 100 / PA_VOLUME_NORM) #define VOL_MP2PA(v) ((v) * PA_VOLUME_NORM / 100) @@ -308,7 +306,7 @@ static int pa_init_boilerplate(struct ao *ao) locked = true; if (!(priv->context = pa_context_new(pa_threaded_mainloop_get_api( - priv->mainloop), PULSE_CLIENT_NAME))) + priv->mainloop), ao->client_name))) { MP_ERR(ao, "Failed to allocate context\n"); goto fail; @@ -396,8 +394,7 @@ static int init(struct ao *ao) goto unlock_and_fail; } (void)pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "video"); - (void)pa_proplist_sets(proplist, PA_PROP_MEDIA_ICON_NAME, - PULSE_CLIENT_NAME); + (void)pa_proplist_sets(proplist, PA_PROP_MEDIA_ICON_NAME, ao->client_name); pa_format_info_set_rate(format, ao->samplerate); pa_format_info_set_channels(format, ao->channels.num); diff --git a/audio/out/internal.h b/audio/out/internal.h index fd45a4a581..8ba789f603 100644 --- a/audio/out/internal.h +++ b/audio/out/internal.h @@ -49,6 +49,9 @@ struct ao { // default device should be used, this is set to NULL. char *device; + // Application name to report to the audio API. + char *client_name; + // Used during init: if init fails, redirect to this ao char *redirect; |