From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BDB3D42C80 for ; Thu, 13 Jan 2022 01:53:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A38D068AF69; Thu, 13 Jan 2022 03:52:14 +0200 (EET) Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ADB4968AEE4 for ; Thu, 13 Jan 2022 03:52:10 +0200 (EET) Received: by mail-qv1-f42.google.com with SMTP id a8so5143154qvx.2 for ; Wed, 12 Jan 2022 17:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BVCK0GeOHyagtrPxYG/ArcICJBUIqMeOtgQVBcMRzRk=; b=DCJZIniVLb6T4Chke02fK7G8oqN7GLnK0qgC1LwDJ81kk5T5NvxA6eeOr+/b/Ycfod gxETcdwYC+w5wfsKn9vy+JV3+Bc0ckmc1h71Av2IM2jd+SOHSWTxKAtGycuEZ+UxeEYZ Uqfd8b78h0yg60FXmbGRSbLKa9KdlReAFN0yjvaBc0FExm0w4hhRWlXAwtfpKi4DftLg oZFH7DTcfnBz/h3kV6YLz66OHcLWC6slGdJ6Bwxc563t32buJ/TrVpEuhZTeqx0kcJGV c2wpuJUfEaDw1U5rPdjdcxqimvDYu9edb1F6LoUaRBdhAc/Hd3zOy061hFYj0m4Ffue4 PxMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BVCK0GeOHyagtrPxYG/ArcICJBUIqMeOtgQVBcMRzRk=; b=dO7ymYZujMh3fztFS8WPLdgEHi5jGxHFzY02zVcb2fl9+a0SkLM39SSQrPra9fTcDM upeNIuHQ4C0JKjiu20JPeDtpDaCXezO7RFQPy6sVV16uOxSzZFymZpepgnoicS/bbKvD 7uwP8siZEm9qAXY6c9YmVTchMBAF64Q8QcYotAPPt4wtetqn2WSd4JA3dm3SW0DkqYnh pInZv9gbl01wenYWxVYII5vP4e8gcxJc6o4uouIB91UnjGyQjXs1Qx2T5EaEZm+DqCUV 3EuXEyqcfd5UGNgOFP5e0vdEUUFy3KlDMbbcdam0koOnaonX4KQTkEjv8an8rubS4/AH 7ugw== X-Gm-Message-State: AOAM531NLPdJs4GcCXD/Bqeu+dQbsdQy+aJ2sf4V5wDWfWJvWgNx3cyX RjgAN3pazBG8D6iX79IJkaxhRDJA0Lg= X-Google-Smtp-Source: ABdhPJxX1pKro8jpX1ws7m8ccpsGDVyYitc4HOQeNtfwBwyHadPVFl64Dgizs9xRH/PYcyWuDeiBJA== X-Received: by 2002:a05:6214:29c3:: with SMTP id gh3mr2430369qvb.112.1642038729037; Wed, 12 Jan 2022 17:52:09 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.52.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:52:08 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:49:31 -0300 Message-Id: <20220113015101.4-10-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113015101.4-1-jamrial@gmail.com> References: <20220113015101.4-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 009/281] 3dostr: convert to new channel layout API 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Anton Khirnov Signed-off-by: James Almer --- libavformat/3dostr.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libavformat/3dostr.c b/libavformat/3dostr.c index 0c136c9ea0..9b6a4d1d86 100644 --- a/libavformat/3dostr.c +++ b/libavformat/3dostr.c @@ -102,15 +102,16 @@ static int threedostr_read_header(AVFormatContext *s) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->sample_rate = avio_rb32(s->pb); - st->codecpar->channels = avio_rb32(s->pb); - if (st->codecpar->channels <= 0 || st->codecpar->sample_rate <= 0) + st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + st->codecpar->ch_layout.nb_channels = avio_rb32(s->pb); + if (st->codecpar->ch_layout.nb_channels <= 0 || st->codecpar->sample_rate <= 0) return AVERROR_INVALIDDATA; codec = avio_rl32(s->pb); avio_skip(s->pb, 4); if (ctrl_size == 20 || ctrl_size == 3 || ctrl_size == -1) - st->duration = (avio_rb32(s->pb) - 1) / st->codecpar->channels; + st->duration = (avio_rb32(s->pb) - 1) / st->codecpar->ch_layout.nb_channels; else - st->duration = avio_rb32(s->pb) * 16 / st->codecpar->channels; + st->duration = avio_rb32(s->pb) * 16 / st->codecpar->ch_layout.nb_channels; size -= 56; found_shdr = 1; break; @@ -135,7 +136,7 @@ static int threedostr_read_header(AVFormatContext *s) switch (codec) { case MKTAG('S','D','X','2'): st->codecpar->codec_id = AV_CODEC_ID_SDX2_DPCM; - st->codecpar->block_align = 1 * st->codecpar->channels; + st->codecpar->block_align = 1 * st->codecpar->ch_layout.nb_channels; break; default: avpriv_request_sample(s, "codec %X", codec); @@ -178,7 +179,7 @@ static int threedostr_read_packet(AVFormatContext *s, AVPacket *pkt) ret = av_get_packet(s->pb, pkt, size); pkt->pos = pos; pkt->stream_index = 0; - pkt->duration = size / st->codecpar->channels; + pkt->duration = size / st->codecpar->ch_layout.nb_channels; return ret; default: av_log(s, AV_LOG_DEBUG, "skipping unknown chunk: %X\n", chunk); -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".