mirror of https://github.com/mpv-player/mpv
ao_pulse: set the property media.role=video
This commit is contained in:
parent
3e5b632559
commit
e5710ccc5d
|
@ -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;
|
||||
|
@ -302,9 +303,19 @@ 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_ERR(ao, "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);
|
||||
|
@ -342,6 +353,10 @@ fail:
|
|||
&& ao->probing))
|
||||
GENERIC_ERR_MSG("Init failed");
|
||||
}
|
||||
|
||||
if (proplist)
|
||||
pa_proplist_free(proplist);
|
||||
|
||||
uninit(ao, true);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue