From patchwork Sun Apr 11 02:12:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 26857 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 9931D44B8A9 for ; Sun, 11 Apr 2021 05:13:03 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 88141680903; Sun, 11 Apr 2021 05:13:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7A17A6802C0 for ; Sun, 11 Apr 2021 05:12:56 +0300 (EEST) Received: by mail-qk1-f173.google.com with SMTP id v70so9838736qkb.8 for ; Sat, 10 Apr 2021 19:12:56 -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=x2FUPGVv2BZhV+D21kVcP3SnJr+z4Wg4zFOwlRaD4hc=; b=A+fWox1YS4vlburV6sFHxNc2uVjVUcnzz9LZITsOnxJX78KC8//QGAu+gCUEYSKX23 Qw558lQdZ3oPHaB4voHSZVF90ivvebPma0mDAbvURCYxyorYT/d8MErnwRfff516xZiq TcicLsFMRBdaPdyk9Z3+IIvbiVd+FE2tLrPA2Dj+wcA593/OPoAAQanXcCUoukW27UKZ dXMQwpTjsFqY8OTu4Zul+hyUNXGD41zQj9yOONuJFcji1/8QcMgH779tvpYBylu7OvhR TNgg9E6154iRzAaAsN8MCt+jAUYWwgNnG6wKsZ6ku51VC477I0pNvHy2K40bXzhgCpRM O2AA== 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=x2FUPGVv2BZhV+D21kVcP3SnJr+z4Wg4zFOwlRaD4hc=; b=fN/2xZUkZI1oI8JLxKGr+wmKtpwQOwvGs96VQBwQ4pJmSe/GCIUEo1Y30iRUiK9qUo vUdVvkJuL9AEiCFbXFPmQrUyNkpOlGbATVezO9P/TSm2tseJVplwkb8F/7GEjNBLFAMg A2YryPCihAp5tUYLcbvPRtyrvzpHVyo62FsyGAokU/sI+1aB2f28jLVXeSnvjrArogpe 2yN+wBlBEn0e0NbRL8vg0t2j8tvALLyhxLtwLH1hsEDf0k4ciY7f7gy0K8Ao2nd+z/fh uTyDy0nPkrVXdPUhF0bMVsZIk9vd1iMsirO8iq9uuZLaXD5ReM7078lKGygEznOtZDCW k3WQ== X-Gm-Message-State: AOAM533uv/GW1AhGLSZk+EATFRBQVftig2DEoG5maCj3ddsTvDM4hI2G 1YJfB8BSGroHZvgc0/S+fk/5aaF01nI= X-Google-Smtp-Source: ABdhPJzALKG7FFDmCMBZSzOe4I1/2wT5bAw1tDLgon8SzNzcHsvcplfcod+WY4FCsGYdc6YfWwK04w== X-Received: by 2002:ae9:f706:: with SMTP id s6mr21502060qkg.163.1618107175229; Sat, 10 Apr 2021 19:12:55 -0700 (PDT) Received: from localhost.localdomain ([191.83.208.158]) by smtp.gmail.com with ESMTPSA id d10sm5083749qko.70.2021.04.10.19.12.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Apr 2021 19:12:54 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 10 Apr 2021 23:12:37 -0300 Message-Id: <20210411021238.29014-2-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 2/3] avcodec/libwebpenc_animencoder: set the correct packet pts 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 only packet produced by this encoder contains the entire animated stream, so its pts is 0. Signed-off-by: James Almer --- libavcodec/libwebpenc_animencoder.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c index 633af2e925..ff36b865f8 100644 --- a/libavcodec/libwebpenc_animencoder.c +++ b/libavcodec/libwebpenc_animencoder.c @@ -32,7 +32,6 @@ typedef struct LibWebPAnimContext { LibWebPContextCommon cc; 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 } LibWebPAnimContext; @@ -48,7 +47,6 @@ static av_cold int libwebp_anim_encode_init(AVCodecContext *avctx) s->enc = WebPAnimEncoderNew(avctx->width, avctx->height, &enc_options); if (!s->enc) return AVERROR(EINVAL); - s->prev_frame_pts = -1; s->done = 0; } return ret; @@ -73,7 +71,7 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt, memcpy(pkt->data, assembled_data.bytes, assembled_data.size); s->done = 1; pkt->flags |= AV_PKT_FLAG_KEY; - pkt->pts = pkt->dts = s->prev_frame_pts + 1; + pkt->pts = pkt->dts = 0; *got_packet = 1; return 0; } else { @@ -102,7 +100,6 @@ static int libwebp_anim_encode_frame(AVCodecContext *avctx, AVPacket *pkt, goto end; } - s->prev_frame_pts = frame->pts; // Save for next frame. ret = 0; *got_packet = 0;