From: Brendan McGrath bmcgrath@codeweavers.com
The avdec_h264 element can use 32MB per thread when working with 4K video.
With 16 threads, this is 512MB, which is a quarter of the RAM available to a 32-bit application. Setting 'max_threads' to 4 can save 384MB. --- dlls/winegstreamer/unixlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/unixlib.c b/dlls/winegstreamer/unixlib.c index f085693cae6..165d38909aa 100644 --- a/dlls/winegstreamer/unixlib.c +++ b/dlls/winegstreamer/unixlib.c @@ -326,12 +326,12 @@ void set_max_threads(GstElement *element) * of RAM each (w * h * bpp). * * So we will instead explictly set 'max-threads' to the minimum of thread_count (process affinity at time of - * initialization) or 16. + * initialization) or 16 (4 for 32-bit processors). */
if (shortname && strstr(shortname, "avdec_") && element_has_property(element, "max-threads")) { - gint32 max_threads = MIN(thread_count, 16); + gint32 max_threads = MIN(thread_count, sizeof(void *) == 4 ? 4 : 16); GST_DEBUG("%s found, setting max-threads to %d.", shortname, max_threads); g_object_set(element, "max-threads", max_threads, NULL); }