[MPlayer-dev-eng] [PATCH 3/5] Prettify main MPlayer source file.

Clément Bœsch ubitux at gmail.com
Sun Apr 17 23:42:43 CEST 2011


On Sun, Apr 17, 2011 at 11:37:17PM +0200, Clément Bœsch wrote:
> On Sun, Apr 17, 2011 at 07:07:05PM +0200, Reimar Döffinger wrote:
> > On Sun, Apr 17, 2011 at 11:03:45AM +0200, Ingo Brückl wrote:
> > > Reimar Döffinger wrote on Sat, 16 Apr 2011 15:41:33 +0200:
> > > 
> > > > On Sat, Apr 16, 2011 at 12:02:51AM +0200, Clément Boesch wrote:
> > > >> Direct use of uncrustify profile with mplayer.c
> > > 
> > > > I thnk I mentioned it before: I'd really like to have a description
> > > > e.g. in DOCS/tech/svn-howto how to verify that the binary has not
> > > > changed.
> > > > Maybe it can even be done with some helper-stuff in the Makefile.
> > > 
> > > I do (in short):
> > > 
> > >   make file.c
> > >   mv file.o somewhere
> > >   uncrustify file.c
> > >   make file.c
> > >   cmp file.o somewhere/file.o
> > > 
> > > Something like this (with file.c backup) should be easily doable in the
> > > Makefile, but due to my experience in Makefile changes I don't feel like
> > > making a start on it. ;-)
> > 
> > Maybe something like this would do:
> > Index: Makefile
> > ===================================================================
> > --- Makefile	(revision 33269)
> > +++ Makefile	(working copy)
> > @@ -820,6 +820,12 @@
> >  codecs.conf.h: codec-cfg$(EXESUF) etc/codecs.conf
> >  	./$^ > $@
> >  
> > +checksums: $(MPLAYER_DEPS) $(MENCODER_DEPS) mplayer$(EXESUF) mencoder$(EXESUF)
> > +	md5sum $^ > checksums
> > +
> > +check_checksums: $(MPLAYER_DEPS) $(MENCODER_DEPS) mplayer$(EXESUF) mencoder$(EXESUF)
> > +	md5sum -c checksums
> > +
> 
> Nicely done. But this will need some adjustments: for example I don't
> remember seeing md5sum on *BSD, but I guess it's not that important. Also,
> it may be necessary to mention the use of ./configure
> --extra-cflags=-DNDEBUG (maybe also something for MP_DEBUG?).
> 

Btw, I just run the test after the 5 patches, and binaries are changed
just because of two changes in the last one:

    @@ -565,13 +547,12 @@ static void mp_dvdnav_context_free(MPContext *ctx)
     {
         if (ctx->nav_smpi)
             free_mp_image(ctx->nav_smpi);
    -    ctx->nav_smpi = NULL;
    -    free(ctx->nav_buffer);
    +    ctx->nav_smpi    = NULL;
         ctx->nav_buffer  = NULL;
         ctx->nav_start   = NULL;
         ctx->nav_in_size = 0;
    +    free(ctx->nav_buffer);
     }


And:

    -// free mplayer config
    -    if (mconfig)
    +    if (mconfig) {
             m_config_free(mconfig);
    -    mconfig = NULL;
    +        mconfig = NULL;
    +    }


Removing those chunks make check_checksums error-free.

-- 
Clément B.


More information about the MPlayer-dev-eng mailing list