]> git.sesse.net Git - vlc/commitdiff
mmal/mmal_picture: Don't wait inifinitely for picture
authorJulian Scheel <julian@jusst.de>
Thu, 4 Sep 2014 10:46:20 +0000 (12:46 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 4 Sep 2014 16:19:35 +0000 (18:19 +0200)
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@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/hw/mmal/mmal_picture.c

index 79a9448051c7a6a8ffd1ed8459dd9a6f4c875d5d..9348a70686a332ee2277433e034e0e9e8de70ed0 100644 (file)
@@ -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;