[FFmpeg-cvslog] ffmpeg: only count got_output/errors in decode_error_stat

Andreas Cadhalpun git at videolan.org
Sun Jul 19 18:28:05 CEST 2015


ffmpeg | branch: release/2.7 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Tue Jun 30 21:09:50 2015 +0200| [70b97a89d2d7ba837c830b1da5924314d68fc3e7] | committer: Andreas Cadhalpun

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: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit bd0f14123fd8c7ff1c27b726d143f84c67f3a522)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70b97a89d2d7ba837c830b1da5924314d68fc3e7
---

 ffmpeg.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 1524ac2..384b92c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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)



More information about the ffmpeg-cvslog mailing list