From 200804c9dd367742e5238f0e09e558146a1b42b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Sichelero?=
 <19790357+andresichelero@users.noreply.github.com>
Date: Mon, 5 May 2025 22:50:42 -0300
Subject: [PATCH] Update server/src/utils/media.ts

- HEVC is not related to format, removed condition
- scale_vaapi takes care of the format

Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
---
 server/src/utils/media.ts | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/server/src/utils/media.ts b/server/src/utils/media.ts
index f251a5d8ed..a1a9a81f78 100644
--- a/server/src/utils/media.ts
+++ b/server/src/utils/media.ts
@@ -781,14 +781,10 @@ export class VaapiSwDecodeConfig extends BaseHWConfig {
 
   getFilterOptions(videoStream: VideoStreamInfo) {
     const options = this.getToneMapping(videoStream);
-    if (videoStream.codecName === VideoCodec.HEVC) {
-      options.push('format=nv12');
-      options.push('hwupload=extra_hw_frames=64');
-    } else {
-      options.push('hwupload=extra_hw_frames=64');
-    }
     if (this.shouldScale(videoStream)) {
-      options.push(`scale_vaapi=${this.getScaling(videoStream)}:mode=hq:out_range=pc:format=nv12`);
+      options.push('hwupload=extra_hw_frames=64', `scale_vaapi=${this.getScaling(videoStream)}:mode=hq:out_range=pc:format=nv12`);
+    } else {
+      options.push('format=nv12', 'hwupload=extra_hw_frames=64');
     }
 
     return options;