[vlc-commits] videotoolbox: fix drain when session is not feed

Thomas Guillem git at videolan.org
Fri Jan 12 09:48:47 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jan  9 09:41:11 2018 +0100| [32b561c86a74bb8b850227b7dcf4527151eb9643] | committer: Thomas Guillem

videotoolbox: fix drain when session is not feed

Since Drain() can now be called when a flush is not requested.

(cherry picked from commit 82641ce4b39aa4073801b3f90a4847bd3819743e)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/codec/videotoolbox.m | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 0c5a8a1f04..a15209b8b4 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1719,11 +1719,8 @@ static void RequestFlush(decoder_t *p_dec)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    /* There is no Flush in VT api, ask to restart VT from next DecodeBlock if
-     * we already feed some input blocks (it's better to not restart here in
-     * order to avoid useless restart just before a close). */
     vlc_mutex_lock(&p_sys->lock);
-    p_sys->b_vt_flush = p_sys->b_vt_feed;
+    p_sys->b_vt_flush = true;
     vlc_mutex_unlock(&p_sys->lock);
 }
 
@@ -1737,7 +1734,7 @@ static void Drain(decoder_t *p_dec, bool flush)
     DrainDPBLocked(p_dec, flush);
     vlc_mutex_unlock(&p_sys->lock);
 
-    if (p_sys->session)
+    if (p_sys->session && p_sys->b_vt_feed)
         VTDecompressionSessionWaitForAsynchronousFrames(p_sys->session);
 
     vlc_mutex_lock(&p_sys->lock);



More information about the vlc-commits mailing list