[vlc-devel] [PATCH 2/6] win32: re-organize audio button/slider updating methods

Daniel Amm da2424 at t-online.de
Wed Dec 16 19:14:12 CET 2015


> On 12/15/2015 10:15 PM, Daniel Amm wrote:
> > This is needed for the next commit
> > ---
> >   common/win32_fullscreen.cpp | 67
++++++++++++++++++++-------------------------
> >   common/win32_fullscreen.h   |  4 +--
> >   2 files changed, 32 insertions(+), 39 deletions(-)
> >
> > diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp
> > index c801760..18768b3 100644
> > --- a/common/win32_fullscreen.cpp
> > +++ b/common/win32_fullscreen.cpp
> > @@ -216,7 +216,13 @@ LRESULT VLCControlsWnd::WindowProc(UINT uMsg,
WPARAM wParam, LPARAM lParam)
> >
> >               CreateToolTip();
> >               RegisterToVLCEvents();
> > -            SyncVolumeSliderWithVLCVolume();
> > +
> > +            if( VP() ){
> > +                vlc_player& vp = *VP();
> 
> Why not fetching the pointer once and compare it against nullptr instead 
> of fetching twice and using a reference afterward?
> I doubt if makes any difference once compiled, though if feels more 
> natural as far as I'm concerned

You're right, it's not very clean to use it different in the same file.
Should we remove these pointers and call VP() directly? The most of code
does that. A pointer is only two times used.
Or is a common pointer better?



More information about the vlc-devel mailing list