diff options
author | Johan Kiviniemi <devel@johan.kiviniemi.name> | 2013-09-20 06:58:08 +0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-20 21:33:32 +0200 |
commit | 0dd66b8b2c833aabc59afc57403b3bd42ce07f0c (patch) | |
tree | f640dd8d35c28bd32b4f98a77a90781533a254d3 | |
parent | 31a5fe6fa8af7356c2c99749c2363d7f364534eb (diff) | |
download | mpv-0dd66b8b2c833aabc59afc57403b3bd42ce07f0c.tar.bz2 mpv-0dd66b8b2c833aabc59afc57403b3bd42ce07f0c.tar.xz |
ao_pulse: set the property media.role=video
Adjusted for the stable branch.
Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r-- | audio/out/ao_pulse.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index 0a7d5347ba..613c444aa9 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -232,6 +232,7 @@ static int init(struct ao *ao) { struct pa_sample_spec ss; struct pa_channel_map map; + pa_proplist *proplist = NULL; struct priv *priv = ao->priv; char *host = priv->cfg_host && priv->cfg_host[0] ? priv->cfg_host : NULL; char *sink = priv->cfg_sink && priv->cfg_sink[0] ? priv->cfg_sink : NULL; @@ -304,10 +305,20 @@ static int init(struct ao *ao) if (!select_chmap(ao, &map)) goto fail; - if (!(priv->stream = pa_stream_new(priv->context, "audio stream", &ss, - &map))) + if (!(proplist = pa_proplist_new())) { + mp_msg(MSGT_AO, MSGL_ERR, "AO: [pulse] Failed to allocate proplist\n"); + goto unlock_and_fail; + } + (void)pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "video"); + + if (!(priv->stream = pa_stream_new_with_proplist(priv->context, + "audio stream", &ss, + &map, proplist))) goto unlock_and_fail; + pa_proplist_free(proplist); + proplist = NULL; + pa_stream_set_state_callback(priv->stream, stream_state_cb, ao); pa_stream_set_write_callback(priv->stream, stream_request_cb, ao); pa_stream_set_latency_update_callback(priv->stream, @@ -344,6 +355,10 @@ fail: && ao->probing)) GENERIC_ERR_MSG(priv->context, "Init failed"); } + + if (proplist) + pa_proplist_free(proplist); + uninit(ao, true); return -1; } |