Fix fate failures: make fate-mov THREADS=32
Unified · Split
| @@ -369,7 +369,7 @@ static int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame) · 368 unmodified lines | ||
| 369 | 369 | AVPacket *pkt = ds->in_pkt; |
| 370 | 370 | // copy to ensure we do not change pkt |
| 371 | 371 | AVPacket tmp; |
| 372 | − int got_frame, did_split; | |
| 372 | + int got_frame, actual_got_frame, did_split; | |
| 373 | 373 | int ret; |
| 374 | 374 | |
| 375 | 375 | if (!pkt->data && !avci->draining) { |
| @@ -431,6 +431,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 55 unmodified lines | ||
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | emms_c(); |
| 434 | + actual_got_frame = got_frame; | |
| 434 | 435 | |
| 435 | 436 | if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) { |
| 436 | 437 | if (frame->flags & AV_FRAME_FLAG_DISCARD) |
| @@ -568,8 +569,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 131 unmodified lines | ||
| 568 | 569 | avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); |
| 569 | 570 | #endif |
| 570 | 571 | |
| 571 | − /* do not stop draining when got_frame != 0 or ret < 0 */ | |
| 572 | − if (avctx->internal->draining && !got_frame) { | |
| 572 | + /* do not stop draining when actual_got_frame != 0 or ret < 0 */ | |
| 573 | + /* got_frame == 0 but actual_got_frame != 0 when frame is discarded */ | |
| 574 | + if (avctx->internal->draining && !actual_got_frame) { | |
| 573 | 575 | if (ret < 0) { |
| 574 | 576 | /* prevent infinite loop if a decoder wrongly always return error on draining */ |
| 575 | 577 | /* reasonable nb_errors_max = maximum b frames + thread count */ |