Elizabeth Figura (@zfigura) commented about dlls/winegstreamer/unixlib.c:
+void set_max_threads(GstElement *element) +{
- const char *shortname = NULL;
- GstElementFactory *factory = gst_element_get_factory(element);
- if (factory)
shortname = gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(factory));
- if (shortname && strstr(shortname, "avdec_") && ELEMENT_HAS_PROPERTY(element, "max-threads"))
- {
const gint32 MAX_THREADS = 16;
gint32 max_threads = MIN(thread_count, MAX_THREADS);
GST_DEBUG("%s found, setting max-threads to %d.", shortname, max_threads);
g_object_set(element, "max-threads", max_threads, NULL);
- }
This kind of element-specific workaround really deserves a comment in the code.
I also don't think MAX_THREADS is really doing much when it's only used in one place, and just writing 16 directly would be just as clear.