vlc | branch: master | Rémi Denis-Courmont <[email protected]> | 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;
 }
 

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to