[vlc-devel] [vlc-commits] aout: always signal when the aout changed

Thomas Guillem thomas at gllm.fr
Mon Sep 26 09:24:37 CEST 2016


On Sat, Sep 24, 2016, at 01:18, remi at remlab.net wrote:
> Hello,
> 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:36:59 2016 +0200| [4bba1e84a13a8d340b8a06df155bec8034bcd012] |
>  > committer: Thomas Guillem
>  >
>  > aout: always signal when the aout changed
>  >
>  > In a previous patch, we signaled that the aout changed when it was
>  > restarted.
> Because the decoder needs to handle it.
> > We also need to signal that event when an aout module selects a
> > device without
>  > requesting a restart.
> No? There is nothing for the decoder to do there.

We may want to restart the decoder in order to try pass-through with the
new selected audio device.
(If the restarted decoder is the same, the aout won't be restarted since
the audio fmt is the same.)

I also thought about always restarting the aout/decoder after a
device_select (and remove sink move in pulse aout) in order to simplify
and have only one way to select a new device with all plugins. But this
may be too overkill.

> > > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4bba1e84a13a8d340b8a06df155bec8034bcd012
>  > ---
>  >
>  > src/audio_output/aout_internal.h | 1 +
>  > src/audio_output/dec.c           | 6 ++++++
>  > src/audio_output/output.c        | 1 +
>  > 3 files changed, 8 insertions(+)
>  >
>  > diff --git a/src/audio_output/aout_internal.h
>  > b/src/audio_output/aout_internal.h
>  > index c6edf8e..a0574fa 100644
>  > --- a/src/audio_output/aout_internal.h
>  > +++ b/src/audio_output/aout_internal.h
>  > @@ -83,6 +83,7 @@ typedef struct
>  >      atomic_uint buffers_lost;
>  >      atomic_uint buffers_played;
>  >      atomic_uchar restart;
>  > +    bool device_changed;
>  > } aout_owner_t;
>  >
>  > typedef struct
>  > diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
>  > index 1751e30..2f97848 100644
>  > --- a/src/audio_output/dec.c
>  > +++ b/src/audio_output/dec.c
>  > @@ -83,6 +83,7 @@ int aout_DecNew( audio_output_t *p_aout,
>  >      owner->input_format = *p_format;
>  >      owner->mixer_format = owner->input_format;
>  >      owner->request_vout = *p_request_vout;
>  > +    owner->device_changed = false;
>  >
>  >      if (aout_OutputNew (p_aout, &owner->mixer_format))
>  >          goto error;
>  > @@ -174,6 +175,11 @@ static int aout_CheckReady (audio_output_t
>  > *aout)
>  >           * left over by an audio visualization:
>  >          input_resource_TerminatVout(MAGIC HERE); */
>  >      }
>  > +    if (owner->device_changed)
>  > +    {
>  > +        owner->device_changed = false;
>  > +        status = AOUT_DEC_CHANGED;
>  > +    }
>  >      return (owner->mixer_format.i_format) ? status :
>  >      AOUT_DEC_FAILED;
>  > }
>  >
>  > diff --git a/src/audio_output/output.c b/src/audio_output/output.c
>  > index 90db056..600705d 100644
>  > --- a/src/audio_output/output.c
>  > +++ b/src/audio_output/output.c
>  > @@ -561,6 +561,7 @@ void aout_OutputUnlock (audio_output_t *aout)
>  >          aout_OutputDeviceSet (aout, owner->req.device);
>  >          free (owner->req.device);
>  >          owner->req.device = (char *)unset_str;
>  > +        owner->device_changed = true;
>  >      }
>  >
>  >      if (owner->req.volume >= 0.f)
>  >
>  > _______________________________________________
>  > 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/4b1731fd/attachment.html>


More information about the vlc-devel mailing list