avcodec/mediacodecdec: Skip dequeue buffer in draining state

There is no more packet to queue in draining state.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
Zhao Zhili 2024-08-24 01:19:38 +08:00
parent 2e370805da
commit aa14f9fe63
1 changed files with 1 additions and 1 deletions

View File

@ -462,7 +462,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
/* feed decoder */ /* feed decoder */
while (1) { while (1) {
if (s->ctx->current_input_buffer < 0) { if (s->ctx->current_input_buffer < 0 && !s->ctx->draining) {
/* poll for input space */ /* poll for input space */
index = ff_AMediaCodec_dequeueInputBuffer(s->ctx->codec, 0); index = ff_AMediaCodec_dequeueInputBuffer(s->ctx->codec, 0);
if (index < 0) { if (index < 0) {