[FFmpeg-devel] [PATCH] ffmpeg.c : replace perror() by av_log

Måns Rullgård mans
Sun Aug 2 19:30:18 CEST 2009


?smail D?nmez <ismail at namtrac.org> writes:

> 2009/8/2 M?ns Rullg?rd <mans at mansr.com>:
>> ?smail D?nmez <ismail at namtrac.org> writes:
>>
>>> Hi;
>>>
>>> Patch attached.
>>>
>>> --
>>> ?smail D?NMEZ
>>>
>>> Index: ffmpeg.c
>>> ===================================================================
>>> --- ffmpeg.c ?(revision 19560)
>>> +++ ffmpeg.c ?(working copy)
>>> @@ -1085,7 +1085,7 @@
>>> ? ? ?if (!vstats_file) {
>>> ? ? ? ? ?vstats_file = fopen(vstats_filename, "w");
>>> ? ? ? ? ?if (!vstats_file) {
>>> - ? ? ? ? ? ?perror("fopen");
>>> + ? ? ? ? ? ?av_log(NULL, AV_LOG_ERROR, "Failed to open stats file.\n");
>>
>> perror() gives a descriptive error message. ?Please use strerror() to
>> provide the same detail here.
>
> Attached a new version using strerror.
>
> Regards.
>
> -- 
> ?smail D?NMEZ
>
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 19566)
> +++ ffmpeg.c	(working copy)
> @@ -1085,7 +1085,7 @@
>      if (!vstats_file) {
>          vstats_file = fopen(vstats_filename, "w");
>          if (!vstats_file) {
> -            perror("fopen");
> +            av_log(NULL, AV_LOG_ERROR, "Failed to open stats file: %s\n", strerror(errno));

Maybe it would be nice to print the failing filename too while at it.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list