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