From patchwork Sun Apr 11 02:12:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 26858 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 AEF0444B8A9 for ; Sun, 11 Apr 2021 05:13:04 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 92C86687F5A; Sun, 11 Apr 2021 05:13:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F3BE2680260 for ; Sun, 11 Apr 2021 05:12:57 +0300 (EEST) Received: by mail-qt1-f178.google.com with SMTP id y12so7330956qtx.11 for ; Sat, 10 Apr 2021 19:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=TeRrBk3Ij5tilqAtOxPyiiavb/ZyEZ7f7PWDgEJ6h/w=; b=hwYSX6QkcrQ7yLguoRbFWNDcpp+JcFGVqEbnSGqeMZg4WpJJmzfM9dwlxkPaNYSWGh a1PoWzB6Y9XzGxJHmKlEvwOoTpUK678p4B6hCb4agYkqISRsXR6yX1mQvPSGIzYTeUH8 hVIz3xsu0w/DRI5HCB2XzFTqsybRixVsEdzAUILmc/7CpB25n1IFUr4NWrU2Wy+SGlUL jr5BJO4spvyBEPf8bWOgDTaNYj+riw4Wp7QWgctOeJZk3rzRg5h/hTJegG40PHsFrgYE 6CmJrMTRsFlQmrGQnq9SivQAcdDNe+7UUBgAN0JURE+PiMsMJ9rh+Xy/1sdTaT6A6sVN 0OFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TeRrBk3Ij5tilqAtOxPyiiavb/ZyEZ7f7PWDgEJ6h/w=; b=WO3ZoLYFEO/CKf82lLaPgfyOIZZvbbKC+rgb0AclBo+IjiHtMmlQKAgcP6KFjUT9wN E71GPqSAPZ9nBQefa3Iojfxsg2ad5KhMWGxSVYj232P0HSNnH1x9oq2uyVGDH64fNtjb U20G20qAwje6Bkn8XjageGxt031Nz57K7WX7hm6bTTs+crDHG0G2o/lyyuuxPG+Y4vgW R+ggr+IPQy9fXMT9Ud0uOGQ0hSmJppu4s0yqsFeRga08ZDTHDvzOvfnHxLaoCtXtY4sg IeEg2XXfSkke4D7miFalbc9WIzsbxdxjFYbVg6xHhVGLgnjxSM/RJ4rPJZWUEGQoC+k6 GS2w== X-Gm-Message-State: AOAM531zgY+FiPFludX3htiHY7/2rz1Q9DEvu1zvXstAtzQ1cwwFepfx ZxYpE+omPe/5ptKc76Qx3b/cNmcq9l4= X-Google-Smtp-Source: ABdhPJzCyt7JM74uQOAlZEu6fJjTrxn44BeJnHi/USeMJMtqHRVXO+uDWB+4jeP7a6O1qBPpJPQ5TA== X-Received: by 2002:a05:622a:110c:: with SMTP id e12mr20146804qty.350.1618107176316; Sat, 10 Apr 2021 19:12:56 -0700 (PDT) Received: from localhost.localdomain ([191.83.208.158]) by smtp.gmail.com with ESMTPSA id d10sm5083749qko.70.2021.04.10.19.12.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Apr 2021 19:12:56 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 10 Apr 2021 23:12:38 -0300 Message-Id: <20210411021238.29014-3-jamrial@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210411021238.29014-1-jamrial@gmail.com> References: <20210411021238.29014-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avformat/webpenc: don't assume animated webp streams will have more than one packet 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The libwebp_animencoder returns a single packet with the entire animated stream, as that's what the external library produces. As such, only ensure the stream was produced by said encoder (or propagated by a demuxer, once support is added) when attempting to write the requested loop value. Fixes ticket #9179. Signed-off-by: James Almer --- libavformat/webpenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c index ed8325c02d..ca4ffc4e2d 100644 --- a/libavformat/webpenc.c +++ b/libavformat/webpenc.c @@ -172,7 +172,7 @@ static int webp_write_trailer(AVFormatContext *s) WebpContext *w = s->priv_data; if (w->using_webp_anim_encoder) { - if ((w->frame_count > 1) && w->loop) { // Write loop count. + if (w->loop) { // Write loop count. avio_seek(s->pb, 42, SEEK_SET); avio_wl16(s->pb, w->loop); }