[FFmpeg-devel] [PATCH] Display decoded frame number on error

Gyan ffmpeg at gyani.pro
Fri Jul 12 11:25:14 EEST 2019



On 12-07-2019 01:15 PM, RĂ©mi Achard wrote:
> ---
>   fftools/ffmpeg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 01f04103cf..fe067007ea 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -2107,7 +2107,7 @@ static void check_decode_result(InputStream *ist, int *got_output, int ret)
>       if (*got_output && ist) {
>           if (ist->decoded_frame->decode_error_flags || (ist->decoded_frame->flags & AV_FRAME_FLAG_CORRUPT)) {
>               av_log(NULL, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING,
> -                   "%s: corrupt decoded frame in stream %d\n", input_files[ist->file_index]->ctx->url, ist->st->index);
> +                   "%s: corrupt decoded frame %llu in stream %d\n", input_files[ist->file_index]->ctx->url, ist->frames_decoded, ist->st->index);
>               if (exit_on_error)
>                   exit_program(1);
>           }

ist->frames_decoded is incremented after the call to this function, and 
in between, the fn returns if decode returned an error, so 
ist->frames_decoded shows the number of successfully decoded frames at 
the point of the result check and not the count of total packets/frames 
sent for decoding upto that point. Is that the intention?

Gyan


More information about the ffmpeg-devel mailing list