[vlc-commits] vout: wait for free picture in vout_GetPicture()

Rémi Denis-Courmont git at videolan.org
Sun Sep 27 22:05:13 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Sep 27 19:49:40 2015 +0300| [6b42b2f75be1d2072f2e7495960e2bda5403be14] | committer: Rémi Denis-Courmont

vout: wait for free picture in vout_GetPicture()

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

 src/video_output/video_output.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 4a76007..937b305 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -383,22 +383,21 @@ void vout_FlushSubpictureChannel( vout_thread_t *vout, int channel )
 }
 
 /**
- * It retreives a picture from the vout or NULL if no pictures are
- * available yet.
+ * Allocates a video output picture buffer.
  *
- * You MUST call vout_PutPicture or picture_Release on it.
+ * Either vout_PutPicture() or picture_Release() must be used to return the
+ * buffer to the video output free buffer pool.
  *
  * You may use picture_Hold() (paired with picture_Release()) to keep a
  * read-only reference.
  */
 picture_t *vout_GetPicture(vout_thread_t *vout)
 {
-    picture_t *picture = picture_pool_Get(vout->p->decoder_pool);
-    if (picture) {
+    picture_t *picture = picture_pool_Wait(vout->p->decoder_pool);
+    if (likely(picture != NULL)) {
         picture_Reset(picture);
         VideoFormatCopyCropAr(&picture->format, &vout->p->original);
     }
-
     return picture;
 }
 



More information about the vlc-commits mailing list