Zebediah Figura : winegstreamer: Unblock waits in sink_chain_cb() when disabling a stream.

Alexandre Julliard julliard at winehq.org
Mon Apr 4 15:37:52 CDT 2022


Module: wine
Branch: master
Commit: bcd39c5061768d6d9a822cb8f8effa715ca62972
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=bcd39c5061768d6d9a822cb8f8effa715ca62972

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Apr  4 11:50:56 2022 -0500

winegstreamer: Unblock waits in sink_chain_cb() when disabling a stream.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/wg_parser.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index a2ce92ccdc7..e7a60ec158a 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -255,6 +255,7 @@ static NTSTATUS wg_parser_stream_disable(void *args)
     pthread_mutex_lock(&parser->mutex);
     stream->enabled = false;
     pthread_mutex_unlock(&parser->mutex);
+    pthread_cond_signal(&stream->event_empty_cond);
     return S_OK;
 }
 
@@ -541,6 +542,12 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu
 
     pthread_mutex_lock(&parser->mutex);
 
+    /* Allow this buffer to be flushed by GStreamer. We are effectively
+     * implementing a queue object here. */
+
+    while (stream->enabled && !stream->flushing && stream->buffer)
+        pthread_cond_wait(&stream->event_empty_cond, &parser->mutex);
+
     if (!stream->enabled)
     {
         pthread_mutex_unlock(&parser->mutex);
@@ -548,11 +555,6 @@ static GstFlowReturn sink_chain_cb(GstPad *pad, GstObject *parent, GstBuffer *bu
         return GST_FLOW_OK;
     }
 
-    /* Allow this buffer to be flushed by GStreamer. We are effectively
-     * implementing a queue object here. */
-
-    while (!stream->flushing && stream->buffer)
-        pthread_cond_wait(&stream->event_empty_cond, &parser->mutex);
     if (stream->flushing)
     {
         pthread_mutex_unlock(&parser->mutex);




More information about the wine-cvs mailing list