From b5d69f067a80fee2857cea7aabe31757b5a1f112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Wed, 28 Feb 2024 11:01:51 +0100 Subject: [PATCH] fix: Fix SAR when transmuxing (#6309) --- lib/transmuxer/h264.js | 2 +- lib/transmuxer/h265.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transmuxer/h264.js b/lib/transmuxer/h264.js index ad7f9cd879..46eb25463b 100644 --- a/lib/transmuxer/h264.js +++ b/lib/transmuxer/h264.js @@ -144,7 +144,7 @@ shaka.transmuxer.H264 = class { const vSpacingTable = [ 1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1, ]; - if (aspectRatioIdc > 0 && aspectRatioIdc < 16) { + if (aspectRatioIdc > 0 && aspectRatioIdc <= 16) { hSpacing = hSpacingTable[aspectRatioIdc - 1]; vSpacing = vSpacingTable[aspectRatioIdc - 1]; } else if (aspectRatioIdc === 255) { diff --git a/lib/transmuxer/h265.js b/lib/transmuxer/h265.js index 64cfd3e5b9..3d46423250 100644 --- a/lib/transmuxer/h265.js +++ b/lib/transmuxer/h265.js @@ -317,7 +317,7 @@ shaka.transmuxer.H265 = class { const sarHeightTable = [ 1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1, ]; - if (aspectRatioIdc > 0 && aspectRatioIdc < 16) { + if (aspectRatioIdc > 0 && aspectRatioIdc <= 16) { sarWidth = sarWidthTable[aspectRatioIdc - 1]; sarHeight = sarHeightTable[aspectRatioIdc - 1]; } else if (aspectRatioIdc === 255) {