avcodec/pthread_frame, decode: allow errors to happen on draining
authorMuhammad Faiz <mfcc64@gmail.com>
Fri, 28 Apr 2017 10:19:13 +0000 (17:19 +0700)
committerMuhammad Faiz <mfcc64@gmail.com>
Sat, 29 Apr 2017 22:48:21 +0000 (05:48 +0700)
commitd535e0c14004a15bb38ea288fa9a4f2e27d26f6b
treeef4a714e4d1bdd2ec9839eb36a79e96290756ebf
parent399c7ab9c6bc9e683c5a60b34d50290ae563e2f1
avcodec/pthread_frame, decode: allow errors to happen on draining

So, all frames and errors are correctly reported in order.
Also limit the numbers of error during draining to prevent infinite loop.

This fix fate failure with THREADS>=4:
  make fate-h264-attachment-631 THREADS=4
This also reverts a755b725ec1d657609c8bd726ce37e7cf193d03f.

Suggested-by: wm4, Ronald S. Bultje, Marton Balint
Reviewed-by: w4 <nfxjfg@googlemail.com>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
libavcodec/decode.c
libavcodec/internal.h
libavcodec/pthread_frame.c