lavc/decode: do not perform decoding when sending draining packets

This way decoding errors will not be returned when the user starts
draining the decoder, avoiding confusion over whether draining did or
did not start.

Fixes failures of fate-h264-attachment-631 for certain numbers of frame
threads (e.g. 5).
This commit is contained in:
Anton Khirnov 2023-06-20 16:10:10 +02:00
parent 69516ab3e9
commit b54603a26a
1 changed files with 1 additions and 1 deletions

View File

@ -674,7 +674,7 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacke
} else } else
dc->draining_started = 1; dc->draining_started = 1;
if (!avci->buffer_frame->buf[0]) { if (!avci->buffer_frame->buf[0] && !dc->draining_started) {
ret = decode_receive_frame_internal(avctx, avci->buffer_frame); ret = decode_receive_frame_internal(avctx, avci->buffer_frame);
if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
return ret; return ret;