From patchwork Wed Aug 24 08:43:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 37449 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2371938pzh; Wed, 24 Aug 2022 01:46:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pgcRkWwr53xuYg3tzDZqMHym8qi/d36Ojb4r4IzHzW9RIof8Qoj2+gwVeD/klauT2Vilv X-Received: by 2002:a17:906:cc13:b0:73d:a2f5:599c with SMTP id ml19-20020a170906cc1300b0073da2f5599cmr2138954ejb.691.1661330776330; Wed, 24 Aug 2022 01:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661330776; cv=none; d=google.com; s=arc-20160816; b=lWkbdW3NJoC8+ThgOanjIenWxFlcfMXfEnL+2xAKuBN93GiT1q3Adz2Pjoyil5ic6c TtObRUZzHpHDSGCsudIVEBJM3DuLQLn2QA+nBym1f1Ee3j7iygcICyZO1y/tUlp/mE/1 m1OzHz+bflzPA0QpYECzcvW+w9s0CUAs92dKFsRZA6Z1cfWz8ZcsBgT0GEzLdYsuuZWf njwApSAFTTG7Xd4dFGD6AFp5GJ1V8ZrcYxzyPZChSR0jRvJu6wpBhuZN4Ld+4W1nhZ68 zBM/Go+R0JM2tyX3TLTQGiB4L+4Q6mQxBIEWqtT4prpT1KHW28/h+4AM3qRWrPBQLI8G MqRw== 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=LH+MjqutURyGeli+b8n1JUNNqCsBUQbEHLMJC2rx1uc=; b=lA0fqe1iID/B2dYBbl1sX1TIO+VGVS2nVvyrIaIY4QwsjDD6PL0J1VMZ+1xvKdtuBj Ojnhj0mmbO3bG3Ww/BOR4Rkp5FXSHnGdJAah8Z8MyB9kYsvyoUARhwbik8hMSFlmev1e ok4cjCReiOsZn8GHqi5UOPpqcsUZNeF8w/H8VcY2lWPckSR0Z5b+QyVBT/QR+gVRO2tR yvwZRD7d9b7h077sPFscQhN3Zmx0tXvBTcuk1YhzRFaAFpCzFqoWkgRKRd2coDKriNGM bgrLIiyxCybvGu0QXiF6NYFBUYLXLQDVievJVkWtXRtBaeDYPEzte/tbRKvCIN+E6RT2 0O1w== 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 o6-20020aa7d3c6000000b0044687b4fb0dsi3439254edr.421.2022.08.24.01.46.15; Wed, 24 Aug 2022 01:46:16 -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 145EF68BA6B; Wed, 24 Aug 2022 11:44: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 DE65768BA0D for ; Wed, 24 Aug 2022 11:43:48 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 2A120240D1E for ; Wed, 24 Aug 2022 10:43:45 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id nz6HzAL2Aup4 for ; Wed, 24 Aug 2022 10:43:44 +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 B9BE6240D20 for ; Wed, 24 Aug 2022 10:43:41 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id B55703A262C; Wed, 24 Aug 2022 10:43:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Aug 2022 10:43:16 +0200 Message-Id: <20220824084318.333-16-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220824084318.333-1-anton@khirnov.net> References: <20220824084318.333-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 16/18] lavf/dv: set audio bitrate only at stream creation 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: zg6GnM16A8G8 Demuxers are not supposed to update AVCodecParameters after the stream was seen by the caller. This value is not important enough to support dynamic updates for. --- libavformat/dv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dv.c b/libavformat/dv.c index f65c2d596f..9c8b0a262c 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -280,6 +280,7 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame) c->ast[i]->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; c->ast[i]->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; c->ast[i]->start_time = 0; + c->ast[i]->codecpar->bit_rate = 2 * dv_audio_frequency[freq] * 16; c->audio_pkt[i].size = 0; c->audio_pkt[i].data = c->audio_buf[i]; @@ -290,7 +291,6 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame) c->audio_pkt[i].pos = -1; } c->ast[i]->codecpar->sample_rate = dv_audio_frequency[freq]; - c->ast[i]->codecpar->bit_rate = 2 * dv_audio_frequency[freq] * 16; } c->ach = ach;