[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout: replace multiple strcmp with a bsearch

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 29 06:12:16 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
fcd6fae7 by Thomas Guillem at 2025-11-29T05:18:48+00:00
vout: replace multiple strcmp with a bsearch

- - - - -
342abe8c by Thomas Guillem at 2025-11-29T05:18:48+00:00
vout: "fps" filter should be static

Fixes the following runtine warning:
"Unsupported timestamp modifications done by chain_interactive"

As a result, pictures are skipped for real when decreasing fps.

- - - - -


1 changed file:

- src/video_output/video_output.c


Changes:

=====================================
src/video_output/video_output.c
=====================================
@@ -850,8 +850,20 @@ typedef struct {
     config_chain_t *cfg;
 } vout_filter_t;
 
+static int strcmp_void(const void *a, const void *b)
+{
+    const char *const *entry = b;
+    return strcmp(a, *entry);
+}
+
 static void ChangeFilters(vout_thread_sys_t *vout)
 {
+    /* bsearch: must be sorted alphabetically */
+    static const char *const static_filters[] = {
+        "amf_frc",
+        "fps",
+        "postproc",
+    };
     vout_thread_sys_t *sys = vout;
     FilterFlush(vout, true);
     DelAllFilterCallbacks(vout);
@@ -887,7 +899,10 @@ static void ChangeFilters(vout_thread_sys_t *vout)
             if (likely(e)) {
                 e->name = name;
                 e->cfg  = cfg;
-                if (!strcmp(e->name, "postproc") || !strcmp(e->name, "amf_frc"))
+                bool is_static_filter =
+                    bsearch(e->name, static_filters, ARRAY_SIZE(static_filters),
+                            sizeof(const char *), strcmp_void) != NULL;
+                if (is_static_filter)
                     vlc_array_append_or_abort(&array_static, e);
                 else
                     vlc_array_append_or_abort(&array_interactive, e);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c18888edf0a5214dd1a0b876fb1fbe3bf79431e8...342abe8c6794332b4ae3440f4bd2428d760ded74

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c18888edf0a5214dd1a0b876fb1fbe3bf79431e8...342abe8c6794332b4ae3440f4bd2428d760ded74
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list