diff options
author | Chocobozzz <me@florianbigard.com> | 2022-11-07 10:43:22 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-11-07 10:43:22 +0100 |
commit | f30ef8cf9888255a58d0d319b741ae27b456185e (patch) | |
tree | 277e584f60dea3bba56f3778710b1dddfdd6f14a /server/lib/transcoding | |
parent | c0a9de6652f53328cda580a8cd11c7ee14242678 (diff) | |
download | PeerTube-f30ef8cf9888255a58d0d319b741ae27b456185e.tar.gz PeerTube-f30ef8cf9888255a58d0d319b741ae27b456185e.tar.zst PeerTube-f30ef8cf9888255a58d0d319b741ae27b456185e.zip |
Fix retranscoding of odd resolution
Diffstat (limited to 'server/lib/transcoding')
-rw-r--r-- | server/lib/transcoding/transcoding.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/lib/transcoding/transcoding.ts b/server/lib/transcoding/transcoding.ts index e6914db87..c7b61e9ba 100644 --- a/server/lib/transcoding/transcoding.ts +++ b/server/lib/transcoding/transcoding.ts | |||
@@ -444,7 +444,9 @@ async function generateHlsPlaylistCommon (options: { | |||
444 | } | 444 | } |
445 | 445 | ||
446 | function buildOriginalFileResolution (inputResolution: number) { | 446 | function buildOriginalFileResolution (inputResolution: number) { |
447 | if (CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION === true) return toEven(inputResolution) | 447 | if (CONFIG.TRANSCODING.ALWAYS_TRANSCODE_ORIGINAL_RESOLUTION === true) { |
448 | return toEven(inputResolution) | ||
449 | } | ||
448 | 450 | ||
449 | const resolutions = computeResolutionsToTranscode({ | 451 | const resolutions = computeResolutionsToTranscode({ |
450 | input: inputResolution, | 452 | input: inputResolution, |
@@ -455,7 +457,9 @@ function buildOriginalFileResolution (inputResolution: number) { | |||
455 | hasAudio: true | 457 | hasAudio: true |
456 | }) | 458 | }) |
457 | 459 | ||
458 | if (resolutions.length === 0) return toEven(inputResolution) | 460 | if (resolutions.length === 0) { |
461 | return toEven(inputResolution) | ||
462 | } | ||
459 | 463 | ||
460 | return Math.max(...resolutions) | 464 | return Math.max(...resolutions) |
461 | } | 465 | } |