[vlc-devel] [PATCH 8/8] mmal/vout: Do not wait for picture in non-opaque mode

Julian Scheel julian at jusst.de
Wed Jun 3 09:37:35 CEST 2015


When not running in opaque mode the buffer headed over for rendering is only
returned when the following buffer isrendered or the component is disabled. So
in this case waiting for the buffer to be returned immediately deadlocks the
rendering. As all buffers get immediately flushed on stop it is safe to skip
this wait for non-opaque usecase.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 modules/hw/mmal/vout.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 6654db2..c58dd3b 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -587,10 +587,12 @@ static void vd_display(vout_display_t *vd, picture_t *picture,
         maintain_phase_sync(vd);
     sys->next_phase_check = (sys->next_phase_check + 1) % PHASE_CHECK_INTERVAL;
 
-    vlc_mutex_lock(&sys->buffer_mutex);
-    while (atomic_load(&sys->buffers_in_transit) >= MAX_BUFFERS_IN_TRANSIT)
-        vlc_cond_wait(&sys->buffer_cond, &sys->buffer_mutex);
-    vlc_mutex_unlock(&sys->buffer_mutex);
+    if (sys->opaque) {
+        vlc_mutex_lock(&sys->buffer_mutex);
+        while (atomic_load(&sys->buffers_in_transit) >= MAX_BUFFERS_IN_TRANSIT)
+            vlc_cond_wait(&sys->buffer_cond, &sys->buffer_mutex);
+        vlc_mutex_unlock(&sys->buffer_mutex);
+    }
 }
 
 static int vd_control(vout_display_t *vd, int query, va_list args)
-- 
2.4.0





More information about the vlc-devel mailing list