[vlc-commits] mmal/mmal_picture: Don't wait inifinitely for picture

Julian Scheel git at videolan.org
Thu Sep 4 18:19:52 CEST 2014


vlc | branch: master | Julian Scheel <julian at jusst.de> | Thu Sep  4 12:46:20 2014 +0200| [adcc436f17bac246aeec7cc443660fd86fb7a483] | committer: Jean-Baptiste Kempf

mmal/mmal_picture: Don't wait inifinitely for picture

Use mmal_queue_timedwait instead of mmal_queue_wait to avoid deadlocks if due
to some unexpected reason no mmal buffer is available for a picture to be
locked. This makes the mmal plugins more robust against mmal internal
failures.

Signed-off-by: Julian Scheel <julian at jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=adcc436f17bac246aeec7cc443660fd86fb7a483
---

 modules/hw/mmal/mmal_picture.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/hw/mmal/mmal_picture.c b/modules/hw/mmal/mmal_picture.c
index 79a9448..9348a70 100644
--- a/modules/hw/mmal/mmal_picture.c
+++ b/modules/hw/mmal/mmal_picture.c
@@ -40,7 +40,7 @@ int mmal_picture_lock(picture_t *picture)
 
     vlc_mutex_lock(get_mmal_opaque_mutex());
 
-    MMAL_BUFFER_HEADER_T *buffer = mmal_queue_wait(pic_sys->queue);
+    MMAL_BUFFER_HEADER_T *buffer = mmal_queue_timedwait(pic_sys->queue, 2);
     if (!buffer) {
         ret = VLC_EGENERIC;
         goto out;



More information about the vlc-commits mailing list