From patchwork Sun Apr 11 00:39:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26852 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 6412B44A20C for ; Sun, 11 Apr 2021 03:39:55 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 30751687F20; Sun, 11 Apr 2021 03:39:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074091.outbound.protection.outlook.com [40.92.74.91]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AA7A7680C54 for ; Sun, 11 Apr 2021 03:39:49 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JzzXHwE5KogOG1w6yjFny37KUHxHX0uMNpRTta2KdiB17vygAoolP5W5KPnzuBnNlLHZM4eo8iV+5Naz9u60+skISyx73d+2fTwllHkH+EAzLCLIGSpfcW2nzjL+c6K/284rxwdwnky0K/AgyIOQmLM1WyqEcI0gjCF7850vaG3Q8B0UwP6+MPuqSe0tRB2PcbnieHCqn+cY6sogBxVJIOOalPrMl2wXvxuk2TH7+L44rx2RnsmFI2q/nSU2W6FOxIbadu7nmlV3Yxq/pwJDNGbz7qvsmfpdxgdDzmA6gbrpP4sH6ENlVpdNPlrHI+DiOPzkgdNSmkAVjFxgWR5Raw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y9sH9DMZbEJVvleWu1Tcwnmd/2GnlNeo5bcCMqitusU=; b=X039SGYXZBS/nfRPuv6gYtI533o6cerFTQ9iTYbOegAZa1iCC4TrcfUtk6KGssCSbvdEXoJgUu4n6JGi0vhzytlwda32v2gE98ATzjgLp0K+jfjFHbjUUlONkJ8UD5HwjBu63cuASFt7TmHB9WVtFz2HONRDKrfwSJOOvF6Ri0cTuoGYLXf7Q+3mDKeRTWl6nJgSjr1reo3vt9UurAK0B6daolyqgsRNQ8vl+snG2yPz9vUUGuP9Rxq82dL3uJD/7Ehc/6I5O37wOjyVOmWia1YsTxEODUsUoPFAEv/IN0X3ETWbqEwzt2EtqRvSzs6O+BZmkj21Vwqia+J4pG+w0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y9sH9DMZbEJVvleWu1Tcwnmd/2GnlNeo5bcCMqitusU=; b=l5ZBnn0NE5oYXicv4JFuL9h9yYUzLNYgXACids2+BINlOIMTU2Q6XqPW6xsShYF1pIM8+k4AppyXKWpKJDWa4kf55Dst41erFUl6idN+lpkMFVi6Z7kQg3AKSadfKShHoNWBb3dgrncbsuUx3jII+t6e5PBBK1DC4eyRshFY5woe04Js9io6RL+kxykH6csMqPFeVIODncQyye8rwD7gb/ACu3KoKwTw3S+jGZBck5MqsYRhVGOcrq4XzPtS0Pnksr7cmedfOepIFREPl/beOYQeh8brFJvPjPgMv4T+ezhqndxNFirWXzj0C4Ttpc+ahZUBnhL+bn8HOQM+N5ibNQ== Received: from HE1EUR04FT003.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::42) by HE1EUR04HT203.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::401) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Sun, 11 Apr 2021 00:39:47 +0000 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com (2a01:111:e400:7e0d::4f) by HE1EUR04FT003.mail.protection.outlook.com (2a01:111:e400:7e0d::273) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Sun, 11 Apr 2021 00:39:47 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:22297BC30DD1D75B7BE4B3154DF07E477A042291CF015D76ECA410F1612704CA; UpperCasedChecksum:BEABBC930AECF3A02C3256C1B3B6BAA670CB757417FD8F3F880ED2C6E9274955; SizeAsReceived:7412; Count:46 Received: from HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::8128:5de5:4e94:9a21]) by HE1PR0301MB2154.eurprd03.prod.outlook.com ([fe80::8128:5de5:4e94:9a21%3]) with mapi id 15.20.4020.022; Sun, 11 Apr 2021 00:39:41 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 11 Apr 2021 02:39:30 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 X-TMN: [ldafcpxdKrTmwvEzDpeGpLbmNALHBAw+] X-ClientProxiedBy: PR1PR01CA0020.eurprd01.prod.exchangelabs.com (2603:10a6:102::33) To HE1PR0301MB2154.eurprd03.prod.outlook.com (2603:10a6:3:2a::22) X-Microsoft-Original-Message-ID: <20210411003932.219580-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.137.96) by PR1PR01CA0020.eurprd01.prod.exchangelabs.com (2603:10a6:102::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.21 via Frontend Transport; Sun, 11 Apr 2021 00:39:40 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 9994b678-18b7-40c4-c6fb-08d8fc824b2c X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQcOwkohpkMj5HspU+N+noE7zBINCdnSfizc/i7sLxFYWX5PGgX5X328Lc9piLrlGPV8wXnjT8xr9ydYx/3KsYtMGC5POrnkDLW0rubnwLm1CHUcAMb5V69/cy2LZzUMMSJjpwNMBFYDa9102YCWGmqjICga5/9Ir7g8+Myo4j1Pfvqfn2chyMagGyXI1Sv/sXY1ocs14KuMhse6R+oQvCamjFihtB+YtFSkdTV24K+N1dFQYCVfC5zLt92oPqnMfJ36s718C2clWtiPmWJNSpDMD276J9csbMsebpDkcVyMIYxZQwfK8AHOkwQt580Wvnd8kPfaHs4oM8187CR63tZU4w8+fr5aS74belt1/4ywSitSl3y3dpfhMZPg8JOMnZcfTXi/yi87vM7mevLDWEGlS6HIT9LOB8D05KGNsihRL2aFylUpPa/ZOMzf8hhJQMLDlZ6iy6ZRbngo5atYBz4ZwRcvyMMyblpPLnxyN/mVjKRIj86kDCR4I013iROfCLW1jGf03CfYPK+pbOwsVc0/XNsKvPeQUMFwNiZUl8IYIpuHQwxPHRXmOerMTE2scDJ1/Poh/ll2w9gA4OaE8ohYb+o/3plHvtEFPPWKgANuH+yKrNn6exUsusGdDw5hzNkBvg9VpHzwjiN67bIppV2zpe0EWaPVpsYNxpzkTmyG4JxtsCK4Wpk8qtLsx30dOrfNai3wfoOOAztrT6iNzsZph8De05LvTprx2O+WdqXegtsLTHj9dDvoUNCkFVNIUk= X-MS-TrafficTypeDiagnostic: HE1EUR04HT203: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FA/KPIjw/dIdIjvUzZ50HCScKiD1es+6R5WSS3RiV6jr/9uIeBn+NSiokXbb5pA+yRSXQIPHFftWsW6C5u1iOsvBs+CoF89Zcblc1Y6zBI1oIqFM4guQduCGy2cLHQ7hc8gVvh4zSz1S323HPs/69IbnmO3/hrNTxdbNh6WX9TaW5egTlunmOAljc29eZQxpaL4HsqREH/cr4CKWOdxwkFxqA6mMfA7YlmT+5HBbd7F0+kipNXNLz6MrCWdj5aD1zcNzZk2bl9mSEhLUxv5KQqLtvFUyDuIaxW+yg3LZZYS0lJzgqPvEWrDIJX+QU1SDYqi/tO9ago2PJPgTe2l3OYRAQH0trXW4wkcb+/bfM4j8nKMqftmRy8XLFhAWXTeZzAi64VzUEZRqhj4jhqIetw== X-MS-Exchange-AntiSpam-MessageData: ASMj0nU0LvTNVuRDnCy5t/w9Un0C6D2+OjSi41cS57YeS81IMoJ8uz7SHP7Jn59riv21w1PnB1xi0kYgvV4wgY2ANikQeIFb/inLTRhV7eU3bjUX8FhCxcJplL6jyWCwqPCedLDMbJBm7+pZzG1mFA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9994b678-18b7-40c4-c6fb-08d8fc824b2c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2021 00:39:41.7055 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT003.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT203 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/libwebpenc_animencoder: Don't return pkt without data/side-data X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" They are essentially forbidden in our encoding API as they are considered empty. So just set the data, but leave the size at zero. (The old encoding API allowed such packets: It used buffer_pkt_valid to record whether the packet is empty or not. This has been changed in 827d6fe73d2f5472c1c2128eb14fab6a4db29032 which broke said encoder. Said regression has been reported in #9179 which this commit partially fixes.) Signed-off-by: Andreas Rheinhardt --- libavcodec/libwebpenc_animencoder.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c index 7f35a0b939..d871e85d43 100644 --- a/libavcodec/libwebpenc_animencoder.c +++ b/libavcodec/libwebpenc_animencoder.c @@ -34,6 +34,7 @@ typedef struct LibWebPAnimContext { WebPAnimEncoder *enc; // the main AnimEncoder object int64_t prev_frame_pts; // pts of the previously encoded frame. int done; // If true, we have assembled the bitstream already + uint8_t padding_buf[AV_INPUT_BUFFER_PADDING_SIZE]; } LibWebPAnimContext; static av_cold int libwebp_anim_encode_init(AVCodecContext *avctx) @@ -103,6 +104,8 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } pkt->pts = pkt->dts = frame->pts; + // Packets without data and side-data are not supported by the API + pkt->data = s->padding_buf; s->prev_frame_pts = frame->pts; // Save for next frame. ret = 0; *got_packet = 1;