]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcode: clean up unused parameters and fix SonarQube issues master
authorJames Hutchinson <jahutchinson99@googlemail.com>
Thu, 24 Jul 2025 10:45:59 +0000 (11:45 +0100)
committerFlole <Flole998@users.noreply.github.com>
Thu, 7 Aug 2025 11:30:27 +0000 (13:30 +0200)
- Removed unused `opts` parameter from _video_filters_get_filters() and tvh_video_context_open_filters().
- Updated all call sites accordingly.
- Split combined variable declaration for clarity.
- Marked AVFilterLink pointer as const to reflect read-only use.

No functional changes — purely code hygiene fallout linked to PR #1859

src/transcoding/transcode/video.c

index ad3033db14d91dae8fcc028eb70472890347aafb..5f65fed6b5063d0a71d1e2800c66300a6706fda2 100644 (file)
@@ -49,7 +49,7 @@ _video_get_sw_deint_filter(TVHContext *self, char *deint, size_t deint_len)
 }
 
 static int
-_video_filters_get_filters(TVHContext *self, AVDictionary **opts, char **filters)
+_video_filters_get_filters(TVHContext *self, char **filters)
 {
     char download[48];
     char deint[64];
@@ -63,7 +63,8 @@ _video_filters_get_filters(TVHContext *self, AVDictionary **opts, char **filters
     int ohw = _video_filters_hw_pix_fmt(self->oavctx->pix_fmt);
     int filter_scale = (self->iavctx->height != self->oavctx->height);
     int filter_deint = ((TVHVideoCodecProfile *)self->profile)->deinterlace;
-    int filter_download = 0, filter_upload = 0;
+    int filter_download = 0;
+    int filter_upload = 0;
 #if ENABLE_HWACCELS
     int filter_denoise = ((TVHVideoCodecProfile *)self->profile)->filter_hw_denoise;
     int filter_sharpness = ((TVHVideoCodecProfile *)self->profile)->filter_hw_sharpness;
@@ -298,7 +299,7 @@ tvh_video_context_open_encoder(TVHContext *self, AVDictionary **opts)
 
 
 static int
-tvh_video_context_open_filters(TVHContext *self, AVDictionary **opts)
+tvh_video_context_open_filters(TVHContext *self)
 {
     char source_args[128];
     char *filters = NULL;
@@ -318,7 +319,7 @@ tvh_video_context_open_filters(TVHContext *self, AVDictionary **opts)
     }
 
     // filters
-    if (_video_filters_get_filters(self, opts, &filters)) {
+    if (_video_filters_get_filters(self, &filters)) {
         return -1;
     }
 
@@ -355,7 +356,7 @@ tvh_video_context_open(TVHContext *self, TVHOpenPhase phase, AVDictionary **opts
         case OPEN_ENCODER:
             return tvh_video_context_open_encoder(self, opts);
         case OPEN_ENCODER_POST:
-            return tvh_video_context_open_filters(self, opts);
+            return tvh_video_context_open_filters(self);
         default:
             break;
     }
@@ -370,7 +371,7 @@ tvh_video_context_encode(TVHContext *self, AVFrame *avframe)
         return -1;
     }
 
-    AVFilterLink *outlink = NULL;
+    const AVFilterLink *outlink = NULL;
 #if LIBAVUTIL_VERSION_MAJOR >= 58
     int64_t *frame_duration = &avframe->duration;
 #else