[MPlayer-dev-eng] [PATCH] Multiple files for MEncoder

D Richard Felker III dalias at aerifal.cx
Tue Feb 8 20:53:40 CET 2005


On Tue, Feb 08, 2005 at 07:58:54PM +0200, Oded Shimon wrote:
> On Tuesday 08 February 2005 19:55, D Richard Felker III wrote:
> > On Tue, Feb 08, 2005 at 11:27:35AM +0200, Oded Shimon wrote:
> > > As most of you probably know, I've been working on multiple file support
> > > for MEncoder. this patch is a "first draft". Things which could be
> > > improved: 1. Somehow remove redundancy by not having most of the same
> > > video init code twice. The init for each next file is a little different
> > > from the first file, so I couldn't just 'goto' to before the init, but
> > > repetitive code is always bad...
> >
> > overall the patch looks like a good start, but i agree this part is
> > really bad. can the duplication be reduced by putting most of this
> > init code into a separate function call?
> 
> Well, yes, but it would need filename, demuxer, sh_video, sh_audio, muxer, 
> mux_v, mux_a, etc... it would be the longest param line ever.

that's not too much already, but maybe there are a lot more?
you could also make these variables global to mencoder.c, since
they're already almost-global anyway (i.e. main() is one hugeass
function..). in the long term we'd want to fix it better, if mencoder
g1 is even maintained in the long term, but it could be ok for now..

> The only solution I can see is wrapping most of the stuff  in the initing in 
> the begginning which isn't done twice around an 'if'. Not very elegant, but 
> better than repetetive code I think.

that would be ok too. probably better.

rich




More information about the MPlayer-dev-eng mailing list