From patchwork Wed Aug 24 08:43:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 37445 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2371711pzh; Wed, 24 Aug 2022 01:45:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pvfW6XfK5QIpJO6QCyYNY1bmDaiZOc4Ng0HZfoByJPH+EPGEjh94U5UjI7eA+T7RDqmMS X-Received: by 2002:a05:6402:5110:b0:440:4cb1:c137 with SMTP id m16-20020a056402511000b004404cb1c137mr7135473edd.262.1661330739600; Wed, 24 Aug 2022 01:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661330739; cv=none; d=google.com; s=arc-20160816; b=F8ibR0ckF0m0Xcy0TrifDsGBmt4vEiFPt1OI2eO22tFpC3SG8Nlb6vBDxvylVtKffr ejsCXhp1K9YqhVsXzUNqXzpbt5rLt8hp2HGUT5DNZVRiXAWGkE2Bf4w2Vjobp7cALDpb hC7BYI3i+B+4ODD50kR+UAH7hXEDHEfiwooL2aaE64cy4FpehHVaX3hWMAkPOhIp1SJG qd0KJwiiVke1eHunOHXPHCPpcKiM614NC1/ZdGXJ/hn+nMJwlm84/CAu1g+38CRKfMlG RI5qr4vybtUBUuGwsrrW+SVhkDNhXAYc+U1FyUV620ywoMXs74i3ewcPRzLi2panVX1N Cbag== 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=yZP9ODUymt6CWtcOC3wBdpg5HZuWsqiPA7OhJPLnh/I=; b=DJ0nttanzQBpK6Mx45bIqNOtvMawazzDAWLCUnDn3ZSW82Gzla0Is7NoAhZKjULHrN lTiyARWTGpqBuT1tWZLGDgmABQjQXN4tg/E57OVMf/m3st9Jvc0RYexMGBA4PtMbhlD0 elnLCFQ23Kwewq7BsR7MzXeBsZHXpKkawwJ0lrkzVktx2NvymS03Ec+Q648Hxm3ixAq1 imKIQ0D7e0mBwH1jpyUF6ZU391QShjWKhcfFzHhG4qyzDUmWC+ZLBxNMA4I1sxJZmb1t a2gOliOrSq2hcYN7AEjMwDOjqDMtX0e5opBtUAxaNartRJNQynwYRmph4uNUK0mYI3Q4 NDlA== 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 e24-20020a056402331800b0044779824259si1273870eda.295.2022.08.24.01.45.39; Wed, 24 Aug 2022 01:45:39 -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 7C27D68B98F; Wed, 24 Aug 2022 11:44:02 +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 2ED4168B9EC for ; Wed, 24 Aug 2022 11:43:50 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 15312240D0E for ; Wed, 24 Aug 2022 10:43:49 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id k5Ebdh2hfeIK for ; Wed, 24 Aug 2022 10:43:48 +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 E3186240D28 for ; Wed, 24 Aug 2022 10:43:41 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id B0F963A260A; Wed, 24 Aug 2022 10:43:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Aug 2022 10:43:15 +0200 Message-Id: <20220824084318.333-15-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 15/18] lavf/dv: set non-changing AVStream fields only once 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: g5ElTzivbTuu --- libavformat/dv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dv.c b/libavformat/dv.c index 24d6897da5..f65c2d596f 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -278,6 +278,8 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame) avpriv_set_pts_info(c->ast[i], 64, c->sys->time_base.num, c->sys->time_base.den); c->ast[i]->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; 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->audio_pkt[i].size = 0; c->audio_pkt[i].data = c->audio_buf[i]; @@ -288,9 +290,7 @@ 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->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; c->ast[i]->codecpar->bit_rate = 2 * dv_audio_frequency[freq] * 16; - c->ast[i]->start_time = 0; } c->ach = ach;