[FFmpeg-devel] [PATCH] Add --avlog-limit configure option.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Sep 22 22:29:08 CEST 2013



On 22.09.2013, at 22:00, Alexander Strasser <eclipse7 at gmx.net> wrote:

>> diff --git a/libavutil/opt.c b/libavutil/opt.c
>> index c035307..d2d116c 100644
>> --- a/libavutil/opt.c
>> +++ b/libavutil/opt.c
>> @@ -25,6 +25,9 @@
>>  * @author Michael Niedermayer <michaelni at gmx.at>
>>  */
>> 
>> +#include "config.h"
>> +// to keep av_opt_show2 working
>> +#undef AV_LOG_MIN_LEVEL
>> #include "avutil.h"
>> #include "avstring.h"
>> #include "common.h"
> 
>  This looks ugly :(

Yeah, though IMHO the whole option printing stuff is ugly.
If some application had only warning level messages enabled it wouldn't get any printout.
And those printouts are associated with a NULL context, so ffplay does such hacks as redirecting the av_log callback.
Probably the functions should have been designed to take a print callback function pointer instead, and ffplay would just pass printf in directly for example (though something more flexible might make more sense, at least a user defined pointer. Or maybe it should just return a malloc'd pointer with the string...).


More information about the ffmpeg-devel mailing list