Commit 70b97a89 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun
Browse files

ffmpeg: only count got_output/errors in decode_error_stat


If threading is used, the first (thread_count - 1) packets are read
before any frame/error is returned. Counting this as successful decoding
is wrong, because it also happens when no single frame could be decoded.
Reviewed-by: default avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: default avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit bd0f1412

)
Signed-off-by: default avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -1874,7 +1874,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
ret = AVERROR_INVALIDDATA;
}
if (*got_output || ret<0 || pkt->size)
if (*got_output || ret<0)
decode_error_stat[ret<0] ++;
if (ret < 0 && exit_on_error)
......@@ -2022,7 +2022,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
);
}
if (*got_output || ret<0 || pkt->size)
if (*got_output || ret<0)
decode_error_stat[ret<0] ++;
if (ret < 0 && exit_on_error)
......@@ -2143,7 +2143,7 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
int i, ret = avcodec_decode_subtitle2(ist->dec_ctx,
&subtitle, got_output, pkt);
if (*got_output || ret<0 || pkt->size)
if (*got_output || ret<0)
decode_error_stat[ret<0] ++;
if (ret < 0 && exit_on_error)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment