From patchwork Mon Dec 13 10:47:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 32414 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp5254931iog; Mon, 13 Dec 2021 02:48:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwye/y2fPaFWWF82hhoPgHVOoiBafgbi3aPg5OfotCgCig8c8Wh3G6gita3/3NyZ/VSyH8k X-Received: by 2002:a17:907:d0b:: with SMTP id gn11mr42387148ejc.355.1639392532047; Mon, 13 Dec 2021 02:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639392532; cv=none; d=google.com; s=arc-20160816; b=laWVmKt5l4w+mqb1xEYQhulkhgEyisafoMYblrJ7atI6QsnBah6nJeJJ422xUwki3P 9AONAGg89aVU501Q7oD8aXgpRmWsCGyn7Orjqs+D3GZeuH2YWa2UofunSgH1hYl147/+ 4dzJ1dmfNXffhMuxzrQQ7kwt7+Tdi4o7A4gOX+ZKmUkRgB+2jQPp9VloKEx8zbFGX17/ XbJUVLW/5h9fTNfzerxRT1KlUkSg9RHcMmbmpfexbjUe3/TMPgqjI9Ulpykm8PBe6qW0 iea7wNThe4+tF4aqk3trV/1GZKXPKz7hdEbPIBALpyAQiP7ZXFaYBu+Z7PS2CKF3YHzA qLDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=NO639D0pmWXi3PWxRA/yjJ9SjXyjugQAripqTdQtl6I=; b=wSjev1OUWg0L4A3lHdlGg93aQA31gVmlEg2zIoVnhMETM2Skp358ZRSIYDREIMwmtN MrEUSIUs+Jn4A+dxwdupTNAPi3Yjgjbw3YiLfz18w/wKvgy2b8CK1GATldb/D/NIn5Z4 C5Mcmr/q1NZAQhNQVrDacDzZjvAeGY0nseolQW/hUQtqUsPDDfvfzLvjlrVAVTkX60P8 IvjZGMmLwqHXFRSNUGkN4/msye6PRqNoTHDjdD7hggaFHUXyKWX8Rpd3ercUQrPfumOT Wfnfb+6jlZqv+x3sNIY3zJFKI5X/9FYLsrZ4yfvMS5P9TrPQRkGEyYy8jelNt6w97Oz0 rnSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ds1si20959463edb.99.2021.12.13.02.48.50; Mon, 13 Dec 2021 02:48:52 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8FB4768AED0; Mon, 13 Dec 2021 12:48:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4723268AE13 for ; Mon, 13 Dec 2021 12:48:40 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 9D18F24017E for ; Mon, 13 Dec 2021 11:48:39 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 2QI2g-euUIw6 for ; Mon, 13 Dec 2021 11:48:39 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 2E2EE24017C for ; Mon, 13 Dec 2021 11:48:39 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 78A3C3A0631; Mon, 13 Dec 2021 11:48:34 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Dec 2021 11:47:25 +0100 Message-Id: <20211213104726.24998-1-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/encode: improve the empty frame check 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: gfYpxtaLBzon Test for buf[0] rather than data[0] (which is broken for some hwaccel formats). --- libavcodec/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index dd25cf999b..5575cf23db 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -366,7 +366,7 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame if (avci->draining) return AVERROR_EOF; - if (avci->buffer_frame->data[0]) + if (avci->buffer_frame->buf[0]) return AVERROR(EAGAIN); if (!frame) {