mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
ao_pulse: use pa_stream_new_extended()
Needed for compressed audio pass-through later.
This commit is contained in:
parent
81bf9a1963
commit
601fb2f93a
@ -274,6 +274,7 @@ static int init(struct ao *ao)
|
||||
struct pa_sample_spec ss;
|
||||
struct pa_channel_map map;
|
||||
pa_proplist *proplist = NULL;
|
||||
pa_format_info *format = 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;
|
||||
@ -347,9 +348,11 @@ static int init(struct ao *ao)
|
||||
(void)pa_proplist_sets(proplist, PA_PROP_MEDIA_ICON_NAME,
|
||||
PULSE_CLIENT_NAME);
|
||||
|
||||
if (!(priv->stream = pa_stream_new_with_proplist(priv->context,
|
||||
"audio stream", &ss,
|
||||
&map, proplist)))
|
||||
if (!(format = pa_format_info_from_sample_spec(&ss, &map)))
|
||||
goto unlock_and_fail;
|
||||
|
||||
if (!(priv->stream = pa_stream_new_extended(priv->context, "audio stream",
|
||||
&format, 1, proplist)))
|
||||
goto unlock_and_fail;
|
||||
|
||||
pa_proplist_free(proplist);
|
||||
@ -392,6 +395,8 @@ unlock_and_fail:
|
||||
pa_threaded_mainloop_unlock(priv->mainloop);
|
||||
|
||||
fail:
|
||||
if (format)
|
||||
pa_format_info_free(format);
|
||||
if (priv->context) {
|
||||
if (!(pa_context_errno(priv->context) == PA_ERR_CONNECTIONREFUSED
|
||||
&& ao->probing))
|
||||
|
Loading…
Reference in New Issue
Block a user