[vlc-devel] [PATCH 1/3] libvlc: introduce 'Muted' as a whole state, not as volume 0
Rémi Denis-Courmont
remi at remlab.net
Thu Jan 7 21:31:58 CET 2010
Le jeudi 7 janvier 2010 22:27:31 Francois Cartegnie, vous avez écrit :
> Le jeudi 7 janvier 2010, Rémi Denis-Courmont a écrit :
> > > int __aout_ToggleMute( vlc_object_t * p_object, audio_volume_t *
> > > pi_volume )
> > > {
> > > + return aout_SetMute( p_object, pi_volume, !aout_IsMuted( p_object
> > > ) ); +}
> >
> > I was under the impression we had a var_ToggleBool() to do exactly that,
> > but atomically.
>
> Well, we're not in the case:
> var_SetBool( "foo", !var_GetBool( "foo" ) );
> There's some job done in SetMute().
>
> So, if we want atomic operations, we need to spinlock the whole operations:
Yes, and it's unfortunate and would take us a bit too far. But how is that an
excuse for not using var_ToggleBool() in this particular case? For one thing,
it spares one lookup of the variable.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the vlc-devel
mailing list