[vlc-devel] [vlc-commits] pulse: restart when we need to move a passthrough input

Thomas Guillem thomas at gllm.fr
Mon Sep 26 11:34:40 CEST 2016


On Sat, Sep 24, 2016, at 01:16, remi at remlab.net wrote:
>
>
> Le 22 sept. 2016 11:32, git at videolan.org a écrit :
>  >
>  > vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Sep 22
>  > 16:40:43 2016 +0200| [a3925097aa23b6179ddf61bb04e43cd9a90e6f7f] |
>  > committer: Thomas Guillem
>  >
>  > pulse: restart when we need to move a passthrough input
>
> Why? If the moved-to sink supports pass-through, there should be no
> problems. If it doesn't, then we should get a format-lost event so the
> change seems redundant. If our input is movef by another client or by
> the daemon, this patch has no effects. And if somehow policy rejects
> the change, the code just breakd audio needlessly.

Could I request a restart only if the sink move failed ?
I agree this is not the same behavior when you change a sink via
pavucontrol. But, for me, if the user explicitly selects a new device,
we shouldn't ignore it.

> >
>  > > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a3925097aa23b6179ddf61bb04e43cd9a90e6f7f
>  > ---
>  >
>  > modules/audio_output/pulse.c | 11 +++++++++++
>  > 1 file changed, 11 insertions(+)
>  >
>  > diff --git a/modules/audio_output/pulse.c
>  > b/modules/audio_output/pulse.c
>  > index a088e44..bde37d3 100644
>  > --- a/modules/audio_output/pulse.c
>  > +++ b/modules/audio_output/pulse.c
>  > @@ -75,6 +75,7 @@ struct aout_sys_t
>  >      char *sink_force; /**< Forced sink name (stream must be NULL)
>  >      */
>  >
>  >      struct sink *sinks; /**< Locally-cached list of sinks */
>  > +    bool passthrough;
>  > };
>  >
>  > static void VolumeReport(audio_output_t *aout)
>  > @@ -655,6 +656,15 @@ static int StreamMove(audio_output_t *aout,
>  > const char *name)
>  >          aout_DeviceReport(aout, name);
>  >          return 0;
>  >      }
>  > +    else if (sys->passthrough)
>  > +    {
>  > +        /* A sink connected with a passthrough input cannot be
>  >          moved */
>  > +        msg_Dbg(aout, "request restart to connect to sink %s",
>  >          name);
>  > +        free(sys->sink_force);
>  > +        sys->sink_force = strdup(name);
>  > +        aout_RestartRequest(aout, AOUT_RESTART_OUTPUT);
>  > +        return 0;
>  > +    }
>  >
>  >      pa_operation *op;
>  >      uint32_t idx = pa_stream_get_index(sys->stream);
>  > @@ -924,6 +934,7 @@ static int Start(audio_output_t *aout,
>  > audio_sample_format_t *restrict fmt)
>  >      sys->flags_force = PA_STREAM_NOFLAGS;
>  >      free(sys->sink_force);
>  >      sys->sink_force = NULL;
>  > +    sys->passthrough = fmt->i_format == VLC_CODEC_SPDIFL;
>  >
>  >      if (encoding == PA_ENCODING_INVALID)
>  >      {
>  >
>  > _______________________________________________
>  > vlc-commits mailing list
>  > vlc-commits at videolan.org
>  > https://mailman.videolan.org/listinfo/vlc-commits
>
> _________________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160926/9624fb65/attachment.html>


More information about the vlc-devel mailing list