From patchwork Sat Sep 18 17:21:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 30359 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp65298iob; Sat, 18 Sep 2021 10:21:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFlnw8Te32ly8hC0u7xBDIm3foazG4dnsoIkPJ5oa+r0XwdAz8P96ZZb8X9ZgM5xKlXZL6 X-Received: by 2002:a17:906:7c52:: with SMTP id g18mr18971420ejp.246.1631985687106; Sat, 18 Sep 2021 10:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631985687; cv=none; d=google.com; s=arc-20160816; b=g22j//x1hR//lmG8zC+8cVWO+Qq4ORqvZSLW+dMF4uSuSpvw8uAzLZuJl/yw5BnPYA dV4fVZPVH/ZzJzU1K5c9luFtU2dDJwxT53nKYISP3qqhxVCD3dpENpsbCtHzNpBAZAmE f/lnTOey+hkCNELBB7sqGRbzWcPICGJQL1slbNugbD/zNGhnByZFQsRqzZpS0LW7Nuk6 J2BbRmEzCRhtL2PN6Y/RIK12KYMbtivW4ntTYXCehCOZLANG7k/Dah4Omt21rBptIvHj d30rV23HDxIdhYR53F8Cvemp7OZyYTd0JVVwMaG46V2OgiHTxTQWMFI+RnIWdt388dsY UXqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=J8nzmSiKBRSNWpOYRvn89bJwml7kx9XIxljT0XvR/aM=; b=XFY1wyqL6LWB599HtuU8D4KndzWfCkDDN8cESe29C+F56cWJuvm+gNHaMjuTZ4vH9w td/w0YAWHtGokbSIJK/azY+h+08sjpt4hvB7dVBPrs27EtexivVueTTn40D+XlSKipvo 77jkYlOi/aTI7CWXRioay41HBe3RM6aGbZdSWmZmqsGbppRI8cf4LkOrtn9eaLMc1hvi 8+kwYdv2Oz7lMLCIKk4ZyaBnA+Yep6JUfT66fuEXba3tRftodaD+bndMhOP+z8hx8SP6 sdi2JYRilEGjggLaVc9IH+S7mzd/JdEhEzvic19ZINesfo2DvF4DxnRKJcU2U8gUnqcS PeKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=j4SxoUK6; 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 b1si13617014ejb.152.2021.09.18.10.21.26; Sat, 18 Sep 2021 10:21:27 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=j4SxoUK6; 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 0E14D68B00E; Sat, 18 Sep 2021 20:21:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD63E68A9EA for ; Sat, 18 Sep 2021 20:21:16 +0300 (EEST) Received: by mail-ed1-f53.google.com with SMTP id v22so38318811edd.11 for ; Sat, 18 Sep 2021 10:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id; bh=Cug1HlhJ4wqEq8pp+TquREz64FVf7jseGqSR8W0N6hA=; b=j4SxoUK6unwz5K/dLc7pukfNNqzfKiTHdo1LaltUhozYZgMI6PVtCDoCDxIpuiKHj3 RSN5iQDfHhHl+8iFLF4Wfp1C4QXlteGQEIz1gtmELYxT6akn4XvzmwbpCJH2rAvY/2/c H7uDKnNmWfzOeBfL3hdaT2d5TKOnczn9Le4cAxNX57Kez37GexeKtHg+Ft8mxMM8OeNl ucbZh3cqu/dYxontCY707GIXF5DEubRDd7HGQ3tkc27yfg5rVi1ru1MejT/X3bVMJOk2 DAiW+y91rGWI/Kz4JG+JqhzHUyvdXcWfWzzUF1sgxFCcnPNJpSz3uHHCmZrNH/wDcvrA xZbw== 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; bh=Cug1HlhJ4wqEq8pp+TquREz64FVf7jseGqSR8W0N6hA=; b=6LQDKPy9fLX8rjwqjfho9MT4BIVc03YU8ba5Z/CTvIhbSaxpmr8QSKIbnlSu41B9BY tjSWApAh2vjpJESJ2w65RpZAVEvpEJvSV/1qHaxdb5CE9/1F9KIW15Ty2INBlz1kNHWO EqRzheVx0fkOpahxvltGsfkZJcDHUmpMpRpR/BN2sX85/zCUsoKfPwsOGX+XERGX5iyQ IC10YKi5Jk0INV9PJ3mLLrMeUQJOMc1xIUXwpNo1HJztHemjSJFaTQussFp5DA6989Cf m/Kj5gq7Ikt33IifVZLEKiUEWceGuEXqAMn4BRFZHywyf1CuuhQnfeP+V2fAOKOy6rxV Pq6w== X-Gm-Message-State: AOAM532TqXT6Wa7leDpfhYadIrBfFuQJuN3S+Aqwm5FmrtseAzgwrie+ cLjlaa6MOgw/Bwbo2tPi8RkTkoRinHo= X-Received: by 2002:a17:906:6691:: with SMTP id z17mr18896520ejo.207.1631985676384; Sat, 18 Sep 2021 10:21:16 -0700 (PDT) Received: from localhost.localdomain ([95.168.121.97]) by smtp.gmail.com with ESMTPSA id p17sm1983573edt.54.2021.09.18.10.21.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 10:21:15 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 Sep 2021 19:21:04 +0200 Message-Id: <20210918172105.5369-1-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/mlpdec: fix decoding single stereo stream in TrueHD 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: VVPgFApIroOl Signed-off-by: Paul B Mahol --- libavcodec/mlpdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index bee47b6cc6..68c270ef52 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -408,6 +408,8 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) mh.stream_type); return AVERROR_PATCHWELCOME; } + if (mh.channel_modifier_thd_stream0 == THD_CH_MODIFIER_STEREO) + m->substream[0].mask = AV_CH_LAYOUT_STEREO; if ((substr = (mh.num_substreams > 1))) m->substream[0].mask = AV_CH_LAYOUT_STEREO; if (mh.num_substreams > 2) @@ -415,7 +417,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) m->substream[2].mask = mh.channel_layout_thd_stream2; else m->substream[2].mask = mh.channel_layout_thd_stream1; - m->substream[substr].mask = mh.channel_layout_thd_stream1; + m->substream[1].mask = mh.channel_layout_thd_stream1; if (m->avctx->channels<=2 && m->substream[substr].mask == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) { av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n"); From patchwork Sat Sep 18 17:21:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 30358 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp65418iob; Sat, 18 Sep 2021 10:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5ylJZ4UfKIkayOGa2V7d+cLwgKVTEva1cu00wIV1icBGRtud2JUSVmJZ4JJzg01k9puH8 X-Received: by 2002:a17:906:1856:: with SMTP id w22mr20105024eje.393.1631985695770; Sat, 18 Sep 2021 10:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631985695; cv=none; d=google.com; s=arc-20160816; b=soszrs0ka/HX1s82fGTzVMfsSrnqL4kQJDgmIP/fwFBltV2cGG8Ac7bTKTazb81Jif sa2xuitCvjgu1gD0SWUljCSSitL0cJBiMHUHaGS43yAy8PmW25yVCItTgpB14Itn9sm4 qDqBDSadBthNCaeU5QWN3Yg5Pfo26LstcsRJ/vC1SRGr8CDmu/hvoANwHTKy5xxwy71x EFHujZsEPN8FeLa/J0X8ipPKXmXyOk3kThOsEzD5s79gODIny3ZcZDWV7cR9WuGigZjv fVgIOEw3Wred6q/+7i7k1w6LMw32yrnS2D4YfuRSi0klxFNdR9GIu0Y4+nQ650xt+g4N JIGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=qm2/k/3xgmKr99JhTgif5H9eMWrWYYCFc318ZGHAOek=; b=nv6zv9RASFVNvfRb+UnYad+hS4XbOJTwIh7IsD7Z08kdIjBymS0hXV35RUxNBVUXPX UMqSGVKnV3vPpBC1l/uFZkBmvaokzk+AWVge0zhzNOV+cvx/fVbdCFJET96hUAzORcdo 8O20KGc2hyqsES/gV3HaZowdyTSxZ7+rAITQvjmNFuigbPL6Z9mnWSwW7wihdvZy3MOe uEmFfEpKm5YbaTt4mKCJWgi00ZyuA4jghpD/bMrr0bD1flv370JEB4pStkFjqfyIzpG0 jgstOILaYuKmI27EzdCs5q88bZanjiN+W7BhXcUqRvAGhNgoyl39oIH8rYfhn7ic2Q7i Nsig== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Niz8NJpW; 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 y98si921716ede.624.2021.09.18.10.21.35; Sat, 18 Sep 2021 10:21:35 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Niz8NJpW; 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 E267568B035; Sat, 18 Sep 2021 20:21:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A94E768A9EA for ; Sat, 18 Sep 2021 20:21:17 +0300 (EEST) Received: by mail-ed1-f54.google.com with SMTP id t6so42629360edi.9 for ; Sat, 18 Sep 2021 10:21:17 -0700 (PDT) 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; bh=IguwISo251587dnmKqewv7a5nrIlyT2wEgkQ8P3kuz4=; b=Niz8NJpWm7oKWCCnRME42fLANuTvksEFo/FFZv9T11kRY4B2B0BP5xCb2bqZjESB+P REZkDItXPxRQHbP97KTR29NQRHzmC0fnlWKAGnJ/o9QsFHm8uIxI0Ilvvp5/7D5sidtq dm3C7rHqNqCIAIZxnjxVLe+nViQCspylkrq8UxXFd03FY/JYxXQrgThLXLHZAs+XTjCT gyPCG8/eRNoRwdgEWNbPJtixzYvydv8fE7N1AdlW463/mlVU23WFhr6+nWPUQDevMhkf Mv+BGpT8aJZ9rT2dMd5gEb2NZ5ys5nSaDA7MOp3Z3/fNHU0/ChkgabO3hbBVx+IOMSlo ENBg== 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; bh=IguwISo251587dnmKqewv7a5nrIlyT2wEgkQ8P3kuz4=; b=JdZb2FNQQ9g3XH6rPPN2gpMCY/0CPS6bx0VzCxiUT5HoClYbmiKvU03DALMPZeC5Tm enbyHVMqnpN0ji8w2stKxux4oICue2O58PtKcdJDZvT4PMutWLUm3LYPE/p5z0yYzTHP XeyekyP/hfUNXRk6ogyFjsHykFMshXtr8GtxC1vtWEWB76dQdwtG5j6RwITKINBNNp09 qKYv+TTvqgjclX1bY6YTQWjmoMipk32Rgyi+3zz5+ZedRMxA/XYLsRYprJaL2nVmi4gs s2L9IXxNEx0Chl0DaKsRoJmjUWKbcJ1PLkM5pAU1ZaNrAnwyEotMSNy8XHJc8Zijrpx3 L66Q== X-Gm-Message-State: AOAM531n9XH/VcjbNUIQOKz0iDDvdFM+vmwFVnBTbe1/2ejbdCT14DD5 /+QWBe9XfDtS6dRnn2pC2pFmnu28wNo= X-Received: by 2002:a17:906:8281:: with SMTP id h1mr18542937ejx.352.1631985677178; Sat, 18 Sep 2021 10:21:17 -0700 (PDT) Received: from localhost.localdomain ([95.168.121.97]) by smtp.gmail.com with ESMTPSA id p17sm1983573edt.54.2021.09.18.10.21.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 10:21:16 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 Sep 2021 19:21:05 +0200 Message-Id: <20210918172105.5369-2-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210918172105.5369-1-onemda@gmail.com> References: <20210918172105.5369-1-onemda@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/mlpenc: fix encoding stereo single stream in TrueHD 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Y4oj3hA26CuM Signed-off-by: Paul B Mahol --- libavcodec/mlpenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index ef01c1d282..b2b3297669 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -626,7 +626,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) ctx->ch_modifier_thd0 = 0; ctx->ch_modifier_thd1 = 0; ctx->ch_modifier_thd2 = 0; - ctx->channel_arrangement = 1; + ctx->channel_arrangement = 0; break; case AV_CH_LAYOUT_5POINT0_BACK: ctx->ch_modifier_thd0 = 1;