[FFmpeg-devel] [PATCH] Fix printf usage in vhook

JonY 10walls
Fri Sep 5 03:14:41 CEST 2008


Stefano Sabatini wrote:
> On date Thursday 2008-09-04 12:54:48 +0800, JonY encoded:
>> Stefano Sabatini wrote:
>>> On date Wednesday 2008-09-03 19:04:27 +0800, JonY encoded:
>>>> Patch fixes some undefined references to "please_use_av_log". Do change
>>>> the AV_LOG levels if inappropriate.
>>>>
>>>> Any ideas fix fprintfs writing to files?
>>>>> vhook/fish.c:369:                        fprintf(f, "P6 %d %d 255\n", width, height);
>>>>> vhook/ppm.c:287:        fprintf( out, "P6\n%d %d\n255\n", width, height );
>>> You have to redefine the av_log() behaviour, setting the av_log callback
>>> function.
>>>
>> Do you have any suggestions where the callback should be pointed to?
>
> Now that I think at it that lines of code print to some file, but
> they're not used for logging purpose so I think it makes no sense to
> use av_log, it would make more sense to #undef fprintf in the files.
>
> [...]
>>> As you may know VHOOK is harshly *deprecated*, nonetheless since we
>>> don't know how much time libavfilter will stay in the limbo, maybe it
>>> would still make sense to apply this.
>>>
>>> Regards.
>> Thanks, I know its depreciated, but I don't know why the errors appeared
>> now, just trying to correct it.
>
> Look at libavutil/internal.h which is included in libavutil/common.h,
> printing functions shouldn't be used in a library.
>
> Regards.

I meant to say that vhook hasn't changed in a while, but why did the 
errors appear only recently? Anyway, I found the cause after checking up 
internal.h.

FFMPEG_FRAMEHOOK_H was changed to AVFORMAT_FRAMEHOOK_H recently in 
libavformat/framehook.h but the ifdefs in libavutil/internal.h, hasn't 
changed to reflect that.

Patch attached.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: internal.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080905/c9f91657/attachment.txt>



More information about the ffmpeg-devel mailing list