From patchwork Thu Jan 13 01:50:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 33358 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp22272iog; Wed, 12 Jan 2022 18:07:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf2hL144S3SBWZCXSJY5420huchbu15OLlB/uogCZ/+rViJdZBNlUC9SOCiRaoo92FWBx4 X-Received: by 2002:a17:906:5509:: with SMTP id r9mr1903692ejp.389.1642039677413; Wed, 12 Jan 2022 18:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642039677; cv=none; d=google.com; s=arc-20160816; b=ZaMUakcA9YLe6KUALFe/YfQC+uxVMhXor61JxovIqdVcLMxeRQAa5ypfGgjYXlly0n ma3nzEdkS2YNvNYyHL5PVsRG0V418NO8Z0PMIibg7gdo79Y99cNewQ5Blifdgh1uwguJ hSLFzto6PAcZpBTKJt+lQxr95k7taTPS54G1mJY3vx3wYu6CK1har9wpBn9ACIveKtCS +LjsmWCVd6eAZey+/HoWea9xYClf4taVj7GLMB4k3QkgCFwOz9c/vZMl2YOgGawXb11C q3uA7+8nuXj68H5LIKuUx1eefdL2TzKNHeNFFu0dR19D4c14z0ZE9YgiJrtAIVZsUr7u miXg== 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:dkim-signature:delivered-to; bh=SCHNtpUEltGDxnMA87ePX59kb8L7rjkUdq0WgbRVcWo=; b=L1TpwI9UOWW6c46NentdQPPYlatTv3yWS8MY0Ho1SV+6KD0mfxHoG0c2NPQKeoeTdZ hK36n6ycMjjQBg7s/UBOyKkFbTJjLDYiTx9vLHSSftIC5CS2Ha/7isDcsPFW3h2O/kww FlQwZgYYGB9GaCk7Knp5nMVRGosiY+D5f4lsfCDuqr95bb0ArhBMfq4PQok8OAf6QCKw 8diPLULiCkYv43KH7ZB3QzeEUx4ozLwEQZYu6NxCbVi9Fe51FzweXNBi6+AcDuzSIQ69 w2CmIY7wZGq7SocOgxJTVAlJCEZFRG32wD/UbyaM1M4vrlHvnnVDlRq/6/ofp1CCk2PW y43Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b="gsCuSG/W"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c5si816877edu.8.2022.01.12.18.07.57; Wed, 12 Jan 2022 18:07:57 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b="gsCuSG/W"; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0467A68B1CD; Thu, 13 Jan 2022 03:53:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F0B0768B1B4 for ; Thu, 13 Jan 2022 03:53:30 +0200 (EET) Received: by mail-qt1-f175.google.com with SMTP id f17so5324562qtf.8 for ; Wed, 12 Jan 2022 17:53:30 -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=eQaFAVUsRSMiAyqjCyTGUh232Kna/vz8lg1Cviz2cEM=; b=gsCuSG/WxKVk9dY7uZ0UJeZ7dRzQ9GqH51TtuMFJCJwRFYsFSgeTkouQlb3nVCEQbi CpZ0Ml1hjmzwqkqB/DmC9xsLCh82Vq+w306wXhIB0Urq66bubeJL4wjwpNm+9v0y0pQR gEHeSLc1ZjJ6dtqdhMOZEsu/lCRsYCJJqVw1xZTNrP2oW6JCUPpYPbG+7iG8+vX15IXr zjJZcTAD2J9Yvtt7sriM8W2O4/SbuJFqooPatRAOBVBI+VOwSEHF+SX9JCwzyWTuXvp3 HZ2tXTRpCpkonhS0Xvx2+HG04yJcZSlIWEJBocVFKjQt0dWyzgBtuM5Vz6FuP6Vemn9D uL7Q== 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=eQaFAVUsRSMiAyqjCyTGUh232Kna/vz8lg1Cviz2cEM=; b=nKC1umnCIWuz3LWFIyQW9w5jcoAYcdQcpQFptiGXG92agmKAA/XVHLuDYGR9ZcDcKK BhKcDksix8FpZidUytwZFvyREvR480SXwTBOvbbmH+9IRAwSG22jCcndKz0+3kS0iLlV o7rYSFj+tvDCEPl1oCufgkinyHeiKPcjsVKu5D2aY7XaBGdw1+VwV45Z5C3LqBJPYcOJ zfvsflh4LI7myyZCtqEFCmzYuCQ/x4ExycNkRnn57yuX91O9GNCq2LsWGwy5BC2hDFHh TxYbaj6FihtDOHJFaY6geXaSvgyy9zTOFBT93XcO5neuJNddo/0yWVb5wnnBwV14QMM0 f3Mw== X-Gm-Message-State: AOAM530ID2FwDGu9Ud52ihbxXn4uhXtWyLCxEoMhsJfOR2mocmGtp/gH T84N3+LtPjeUEX49aIBbAT9cFS0J0BA= X-Received: by 2002:a05:622a:149:: with SMTP id v9mr1990427qtw.183.1642038809547; Wed, 12 Jan 2022 17:53:29 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id i21sm1204710qti.31.2022.01.12.17.53.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 17:53:29 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jan 2022 22:50:36 -0300 Message-Id: <20220113015101.4-75-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 074/281] hls_sample_encryption: 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: MRxIUAqT+8h3 Signed-off-by: James Almer --- libavformat/hls_sample_encryption.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libavformat/hls_sample_encryption.c b/libavformat/hls_sample_encryption.c index 3dbaff717e..159a6edc6e 100644 --- a/libavformat/hls_sample_encryption.c +++ b/libavformat/hls_sample_encryption.c @@ -109,13 +109,14 @@ int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info) } st->codecpar->sample_rate = ac3hdr->sample_rate; - st->codecpar->channels = ac3hdr->channels; - st->codecpar->channel_layout = ac3hdr->channel_layout; + av_channel_layout_uninit(&st->codecpar->ch_layout); + av_channel_layout_from_mask(&st->codecpar->ch_layout, ac3hdr->channel_layout); st->codecpar->bit_rate = ac3hdr->bit_rate; av_free(ac3hdr); } else { /* Parse 'dec3' EC3SpecificBox */ GetBitContext gb; + uint64_t mask; int data_rate, fscod, acmod, lfeon; ret = init_get_bits8(&gb, info->setup_data, info->setup_data_length); @@ -131,11 +132,12 @@ int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info) st->codecpar->sample_rate = eac3_sample_rate_tab[fscod]; - st->codecpar->channel_layout = ff_ac3_channel_layout_tab[acmod]; + mask = ff_ac3_channel_layout_tab[acmod]; if (lfeon) - st->codecpar->channel_layout |= AV_CH_LOW_FREQUENCY; + mask |= AV_CH_LOW_FREQUENCY; - st->codecpar->channels = av_get_channel_layout_nb_channels(st->codecpar->channel_layout); + av_channel_layout_uninit(&st->codecpar->ch_layout); + av_channel_layout_from_mask(&st->codecpar->ch_layout, mask); st->codecpar->bit_rate = data_rate*1000; }