Module: wine Branch: master Commit: ce9a42e8bda50fd5eb91c8dee78f310881d2c7e5 URL: https://source.winehq.org/git/wine.git/?a=commit;h=ce9a42e8bda50fd5eb91c8dee...
Author: Zebediah Figura zfigura@codeweavers.com Date: Fri Apr 8 12:11:09 2022 -0500
winegstreamer: Enable wg_parser streams on creation.
This patch is motivated by Obduction, which creates a Media Foundation source and leaves it open arbitrarily long before actually reading samples from it. Without this patch, we unnecessarily waste CPU, and may reduce graphical performance by taking CPU time that would otherwise be used on performance-critical threads.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/winegstreamer/wg_parser.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 9b3a5ca796d..48b88a4b11c 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -1293,6 +1293,13 @@ static NTSTATUS wg_parser_connect(void *args) pthread_cond_wait(&parser->init_cond, &parser->mutex); } } + + /* Now that we're fully initialized, enable the stream so that further + * samples get queued instead of being discarded. We don't actually need + * the samples (in particular, the frontend should seek before + * attempting to read anything), but we don't want to waste CPU time + * trying to decode them. */ + stream->enabled = true; }
pthread_mutex_unlock(&parser->mutex);