[vlc-commits] codec: videotoolbox: explicitly drain

Thomas Guillem git at videolan.org
Mon Sep 11 17:12:29 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Sep 11 16:34:36 2017 +0200| [f88124fc3324e45700c81d049985d4472eca28e5] | committer: Thomas Guillem

codec: videotoolbox: explicitly drain

Instead of just waiting for frames.

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

 modules/codec/videotoolbox.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index e6a8efbff1..1a8e4416ca 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1310,7 +1310,14 @@ static void Drain(decoder_t *p_dec)
 
     /* draining: return last pictures of the reordered queue */
     if (p_sys->session)
-        VTDecompressionSessionWaitForAsynchronousFrames(p_sys->session);
+    {
+        OSStatus status =
+            VTDecompressionSessionFinishDelayedFrames(p_sys->session);
+        if (status == noErr)
+            VTDecompressionSessionWaitForAsynchronousFrames(p_sys->session);
+        else
+            msg_Warn(p_dec, "VTDecompressionSessionFinishDelayedFrames failed");
+    }
 
     vlc_mutex_lock(&p_sys->lock);
     DrainDPB(p_dec, false);



More information about the vlc-commits mailing list