[MPlayer-dev-eng] [PATCH] split filter_n_bytes function a bit

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Nov 4 11:39:49 CET 2007


> > > Additionally your patch breaks the EOF/error logic.
> > 
> > I don't see it right now, can you explain?
> 
> I read it carelessly and thought it was checking the output len like the
> old code. Change "breaks" to "obfuscates".

Here I disagree, the current code pretends to check for errors/EOF,
while it actually only checks if for some reason the decoder didn't
return any data. Most likely that means EOF or error but not
necessarily.
The overall return value of filter_n_bytes indicates if it filtered as
many bytes as requested or not, nothing else.
Maybe the name filled_len is obfuscated, the check itself IMO is not.
Also, with 45 lines the current filter_n_bytes with 45 lines isn't the
tiny piece of code you make it sound like, though admittedly the
fill_in_buffer part alone is quite small for a function (though there
are a lot more buffer-filling functions in MPlayer with about the same
size - admittedly they are used in more than one place).
Either way I'll see if I can come up with a better name for some
functions, but I'm not good at that.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list