History

avcodec/decode: do not treat discarded frames as eof when draining

Fix fate failures: make fate-mov THREADS=32

Muhammad Faiz committed 9 years ago

Commit 9b4648a1 parent 2da5bf41 file · +5 −3Browse files

Unified · Split

libavcodec/decode.c+5−3
@@ -369,7 +369,7 @@ static int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame) · 368 unmodified lines
369369 AVPacket *pkt = ds->in_pkt;
370370 // copy to ensure we do not change pkt
371371 AVPacket tmp;
372− int got_frame, did_split;
372+ int got_frame, actual_got_frame, did_split;
373373 int ret;
374374
375375 if (!pkt->data && !avci->draining) {
@@ -431,6 +431,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 55 unmodified lines
431431 }
432432 }
433433 emms_c();
434+ actual_got_frame = got_frame;
434435
435436 if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
436437 if (frame->flags & AV_FRAME_FLAG_DISCARD)
@@ -568,8 +569,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 131 unmodified lines
568569 avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
569570 #endif
570571
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) {
573575 if (ret < 0) {
574576 /* prevent infinite loop if a decoder wrongly always return error on draining */
575577 /* reasonable nb_errors_max = maximum b frames + thread count */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t