From patchwork Fri Apr 14 16:42:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41187 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp642740pzb; Fri, 14 Apr 2023 09:43:51 -0700 (PDT) X-Google-Smtp-Source: AKy350bfe5/kdhn0IHIkqvxUX5U0wKSYqWmftLuhsiIahkoKtBBLr2s7PnbJChJWnHHIJuL7M05S X-Received: by 2002:a17:907:2395:b0:878:711d:9310 with SMTP id vf21-20020a170907239500b00878711d9310mr6201923ejb.1.1681490631381; Fri, 14 Apr 2023 09:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681490631; cv=none; d=google.com; s=arc-20160816; b=wzUpsybOYsJUSKE/f74+VejFEiq1ltTfXjP0HQHrNuKQlI5zI4eQNiYxebbQdeKw/h xXbP/0V/EaEh0QEIQSC89g0B+3Gg613enR8i/dSyIGLi3EwZkXQz8jaXRryaK6eL2LkF 3qZClXUYfRu7KYtnoaOv6Cq8Q8BWQxR6gn+nG7Ev+FffCYCRYo16ap1+TkTXey5Hdsk7 jry0dWkRZFYCtT16S2nO3AoxGj4/b5fe+oVEyWqry0yiS+lrVnW1g9mZCl94RpJUy9e5 +RoV3OkGR3LaOHPdCFRzhrue3/f3/NsDTbM4DufxHEAzMFMEJYStCj3H3gBzCwso8mCN U/jQ== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=jca3DbFRTuXg7rFMILiuDsfEqPR8ZPP3WqVNDVzxS6A=; b=hPDnKIg+w/shB2l3DF44FM8XncVKsdS6wKQGPSjuTd9flsrs3DS3FNwCkFIqMK3oln Q9r1ORc0AvGWp7iZY1L5xPqLqfp9yfIzRHWkpS3EABJAdLA3MaXCwmoIvCpU5Fiu3L6j Zay7qnHsx9KP+KwFmhpakY0h3b/W7teoItHm3UBbWkAkHWTUcKeynxWxxCYMo/NJIc5q /1M7vfgskRyPXscRPYmIkgPSNpi6r4B4k6ECdzEKwAV4uoIjZr9BvznwvczfQg4c0/hE uia1xHg96eP6cqo++O3X7mrwhBrxcAm0I0qGenYGXSCwdONwxfF4a0ukOwQ/8cizvJgQ Qmsg== 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 n2-20020a1709062bc200b00932af15caa7si4828920ejg.731.2023.04.14.09.43.46; Fri, 14 Apr 2023 09:43:51 -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; 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 9272F68BEFF; Fri, 14 Apr 2023 19:43:06 +0300 (EEST) 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 631B168BEF3 for ; Fri, 14 Apr 2023 19:43:00 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 23D122404F5 for ; Fri, 14 Apr 2023 18:42:56 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id u0v4hw9RC02C for ; Fri, 14 Apr 2023 18:42:55 +0200 (CEST) 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 33B8C2405B5 for ; Fri, 14 Apr 2023 18:42:54 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id D70C23A0567 for ; Fri, 14 Apr 2023 18:42:47 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 Apr 2023 18:42:43 +0200 Message-Id: <20230414164244.15264-6-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230414164244.15264-1-anton@khirnov.net> References: <20230414164244.15264-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/7] fftools/ffmpeg_enc: set audio frame duration when encoding 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: h5lQqb40ucGb --- fftools/ffmpeg_enc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index a0779c45ae..00cccef65b 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -795,6 +795,8 @@ static void do_audio_out(OutputFile *of, OutputStream *ost, av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base); } frame->time_base = enc->time_base; + frame->duration = av_rescale_q(frame->nb_samples, (AVRational){1, frame->sample_rate}, + enc->time_base); if (!check_recording_time(ost, frame->pts, frame->time_base)) return;