From patchwork Fri Aug 23 17:19:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 51128 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:b3c7:0:b0:48e:c0f8:d0de with SMTP id g7csp501987vqt; Fri, 23 Aug 2024 10:45:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUoRV2v3+YwzUDpXbJQSbL61nkmG5m5Gmtjn413Z/8p81FSyKkNi3sqU6gRjMvehI1UFjB0pI3/dyM0Yp+kNhFu@gmail.com X-Google-Smtp-Source: AGHT+IHuvzjT2tBNwb0jyN26/LI90Yap6/dSzt180pt4+Umzs2BvNEC98UHgRCyVRADfQXBsFlj4 X-Received: by 2002:a05:6402:510e:b0:5be:c227:87d5 with SMTP id 4fb4d7f45d1cf-5c08811703cmr3167489a12.1.1724435105820; Fri, 23 Aug 2024 10:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724435105; cv=none; d=google.com; s=arc-20160816; b=XqkAX5NohJLTmw92IdAsoBiDBxZLKyGnBI75SMF3pyjU8UnkusvA3elHrH7hPoqunp ol3i6zPObvcqCyi4wN2xT/uIJfOuY2EqLjQi5HbtmpkD/fWTG+BZFYkMKSClO1ypwxoq ghy7ycuTUq1pGvyxxBUzsCUZ92GTaDPOhfmW++LKfvvmietZhdpDSAeNz4BMEq1Rt4zl +3MxR0piTLxaM7WsG6b4tPJDvex+3JJpb3bR8AJwiarmhABEijQv5Uogh1tXDTvLidTi NbVGlfr685I1uG62Vb9k70kGMYQvtO/VBQhqTnoeuED03lEXaMyozpK11CHpVbSJXY7O wjxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:date:to:from:message-id :dkim-signature:delivered-to; bh=eWyIjrDjhwdqfnXWJsqsAstTrbgaIbG04yGoGKoT8K8=; fh=HnHYuZ9XgUo86ZRXTLWWmQxhslYEI9B9taZ5X1DLFfc=; b=PdfbFkXgfFrfP6nVynB48FaAj8Jrd6VQ0omIY3MySrMYeK/HDmwHKLSleYQvFfroyN ARvVyEIsb7lKTCC8zp+ZKv6vPo8I6btosOTHSWt/+bwirTPkUpRhPultKHV5Fh4lxih5 Jku/8tUlgJ5RYPLvTe4IKsCIpLHXZiBcCPqCx0Wvld4R3ytbPJYO3wZcHDWdmhVqzcIE fYHOnWd4EwGsal0W39Sk/etRuo7dD1pJ6hog8+2Hca8ANrllFjJqHglmKJaIF6u4g5No iH0b3F+4arwqyQsFUUzXQ8C0wIfygfjQq+Owemuo4jRF+mQ7rl+KDkWC7oL0NFQCDQlg CC6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=eDCCUzle; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c0516013aesi3015303a12.568.2024.08.23.10.45.05; Fri, 23 Aug 2024 10:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=eDCCUzle; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB18768D9BD; Fri, 23 Aug 2024 20:19:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-221-164.mail.qq.com (out203-205-221-164.mail.qq.com [203.205.221.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A8DE68DAE5 for ; Fri, 23 Aug 2024 20:19:49 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1724433581; bh=YT0KK0VVc9O3sP4CK7kWgAVbiyEhChwg0Jpyhq36lhM=; h=From:To:Cc:Subject:Date; b=eDCCUzleebuBtyyh2k7i8K4V28c54Acw28liC++4oGIqZCCCl4DISbXRd334/5yte Nz3Z0DECTe9dt4Lp4WAYq0gr6d5m8QDK8AQv+1R4U99TgiSZHAXghx3WiJtOa3iyPz ecSHgezDj4JNYad//RbvO26+Aq3hIMgHklhgwZNU= Received: from ZHILIZHAO-MB1.tencent.com ([113.116.29.243]) by newxmesmtplogicsvrsza10-0.qq.com (NewEsmtp) with SMTP id 4E83E677; Sat, 24 Aug 2024 01:19:40 +0800 X-QQ-mid: xmsmtpt1724433580tzmwhnws1 Message-ID: X-QQ-XMAILINFO: MGhvBmtDPvWEL/YY/ZMz88Nwhl4pOv0AeBL/NpKM1FHKFVjtaIIM6vQ+dh+/0a Ce1Ok9LzwSVC+fd6E8xJOKQJa+6oEZ6KqPcc/zobelaftIvryP8yAhYglv4GvdsImI892Kbwn0Af Hn2fGhfpfJOXNHW8aiH+vcLVnoGL838zG6g8dVzaqgxyONNvmtELbQ9KgjDzUSgm3oIj/tcD32tN LjWQiQ0cnZNFI3cjkBfR5wHV0bWvLbME03i7mG4HOlKmRhocJBQMesQnBrZuciXu/41+59vaoN7q qXNkZ41m38WT+LcvLzLec1GuMSLi5hDZ3BY6eAFNGjV+A/XB9OYv+Q+ZShbZW82o6whhwYc5iO4y tXbVUb+1vfmtX0ZwLbw8isBElxdGDonrgOJwttSeS5FoNMoW5XMn+ibP+0/8WqlPDp+LgGXMdvzo wmOdypWCXCyWAfTFbG5bJW3BVDowlKow8zI3xcuHIo+w4CoajrkhB+VTJZ+CkMiLo7Nuf1TDBx1B eINoh5Lh2yhGXAvAC4zuCmSnbRPlgx0cfaGM8JrxhFt1Cq2G09XEu8dInmTBjxJ8oE7/uOl1TQF2 Xkpl1RrC0+2YHEcG0FuRGM4Atbhl85wqPwkWDjlbnWnpMuknYlXB3FhyYZ+qN21VITINxisMAX2/ fYuRPK/a6/9OGOZYBbCR0xwBKMDU7zLnWXPtIxv8LQudZmSXy486hoy/nuIGNK7mkSvIZxktTqYX mYedBRuKJJJSH7R8nQxg5iXFB9HlQ3FxvKBdNMDGqhOqenDJuFhebb9lnLDsc+qs9RhCmkIrqFWa uK5UglcvpNYFj84H0TgKUQTvqogkT8FsCa4jRTxmy0QVsrHH07VJ5AuM15MeHtZk6bgTyS79OuoD L2uhmZP0SAoRwAQngBB09FvAvGr1EDcScczSBD7U/FYDcSNjY+nDKxKnnTyZLqnxdkZd0DCNq9Wh jcsW8odbL+yxzB0IILci9mGK2/d4s5YJ/iIzalke5wy8+Zjg7RKSIRoOgFO/iOKYJoXrQ+JX3JeA wvrE89zWGAkP8WVyCsJztMnVBav7E= X-QQ-XMRINFO: Mp0Kj//9VHAxr69bL5MkOOs= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Sat, 24 Aug 2024 01:19:38 +0800 X-OQ-MSGID: <20240823171938.75791-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mediacodecdec: Skip dequeue buffer in draining state X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3bmIE9pV1My+ From: Zhao Zhili There is no more buffer to queue in draining state Signed-off-by: Zhao Zhili --- libavcodec/mediacodecdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c index 6d8dc600fe..0da5fe6729 100644 --- a/libavcodec/mediacodecdec.c +++ b/libavcodec/mediacodecdec.c @@ -462,7 +462,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame) /* feed decoder */ while (1) { - if (s->ctx->current_input_buffer < 0) { + if (s->ctx->current_input_buffer < 0 && !s->ctx->draining) { /* poll for input space */ index = ff_AMediaCodec_dequeueInputBuffer(s->ctx->codec, 0); if (index < 0) {