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 994BA489E0 for ; Fri, 22 Dec 2023 15:09:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3661F68D315; Fri, 22 Dec 2023 17:09:48 +0200 (EET) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA45368D30E for ; Fri, 22 Dec 2023 17:09:41 +0200 (EET) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3bb6179dcb1so447320b6e.0 for ; Fri, 22 Dec 2023 07:09:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703257780; x=1703862580; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ATqOk4hQ3zEUU8fo/HFvnG8KXHxPHwcFZIqdgwmMrUQ=; b=k1aMXRvFtgI0mm7zOHkzLKQ0OJJSbTxt5rBZDbHjDDy78ZVeFufuyr6vZ5Lj94TP1s sGfarQcGv/VNvEoNa9g4l6KkhVaeER8RX4t2JB6BO2pT7X0Tsi87S6WyVNkTvMKC66SF ERqQWIz8+I9c7X/gtJFC7KyyJUmirvVTBEqLm9rMPLnU51g7IM1Dr85G0V+wdyzwatP7 0PnayNMyGe/CKinwc09rMC0wSfgipNnIihZJ+M32IgcAIWGD7kXoMC4TWdACx0SO6tbm PbxsgVJ9pbkvltRNyTewvPZZ0EVXLvh6tq+Cwzz44POH2387YvKdpcGLCNUypeGMYGHO tQZQ== X-Gm-Message-State: AOJu0YzPTEEDwPuAN1190Swa9RNikyOPHafUDnxG+++oUf6LgMZNeAch h0gp7ULfOe+J/Dh/XyhiFlQNicGN31U= X-Google-Smtp-Source: AGHT+IFfFMrYhEm6u0xurqz2LMNl/JLMyKhK/D9XDtDqHrjIX6NJwY5Kc9WKQDJcVmlRtEpT00PmKA== X-Received: by 2002:a05:6358:8a9:b0:172:c4af:41ae with SMTP id m41-20020a05635808a900b00172c4af41aemr2745978rwj.1.1703257779396; Fri, 22 Dec 2023 07:09:39 -0800 (PST) Received: from Romains-MBP.attlocal.net ([2600:1700:1310:46d0:a043:b823:f09c:6f5b]) by smtp.gmail.com with ESMTPSA id q2-20020a25f902000000b00dbccef3a8fcsm1546343ybe.28.2023.12.22.07.09.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 22 Dec 2023 07:09:38 -0800 (PST) From: Romain Beauxis To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Dec 2023 09:04:24 -0600 Message-Id: <20231222150423.52986-1-toots@rastageeks.org> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavformat/hlsenc.c: Populate OTI using AAC profile in write_codec_attr. 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 Cc: Romain Beauxis 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: This patch populates the third entry for HLS codec attribute using the AAC profile. The HLS specifications[1] require this digit to be the Object Type ID as referred to in table 1.3 of ISO/IEC 14496-3:2009[2]. The numerical constants in the code refer to these OTIs minus one, as documeted in commit 372597e[3], confirmed by comparing the values in the code with the values in the table mentioned above. Links: 1: https://datatracker.ietf.org/doc/html/rfc6381#section-3.3 2: https://csclub.uwaterloo.ca/~ehashman/ISO14496-3-2009.pdf 3: https://github.com/FFmpeg/FFmpeg/commit/372597e5381c097455a7b73849254d56083eb056 --- libavformat/hlsenc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 7049956dd7..2551bac6ae 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -418,8 +418,10 @@ static void write_codec_attr(AVStream *st, VariantStream *vs) } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) { snprintf(attr, sizeof(attr), "mp4a.40.34"); } else if (st->codecpar->codec_id == AV_CODEC_ID_AAC) { - /* TODO : For HE-AAC, HE-AACv2, the last digit needs to be set to 5 and 29 respectively */ - snprintf(attr, sizeof(attr), "mp4a.40.2"); + if (st->codecpar->profile != AV_PROFILE_UNKNOWN) + snprintf(attr, sizeof(attr), "mp4a.40.%d", st->codecpar->profile+1); + else + goto fail; } else if (st->codecpar->codec_id == AV_CODEC_ID_AC3) { snprintf(attr, sizeof(attr), "ac-3"); } else if (st->codecpar->codec_id == AV_CODEC_ID_EAC3) { -- 2.39.3 (Apple Git-145) _______________________________________________ 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".