[vlc-commits] videotoolbox: don't reset the vout when closing

Thomas Guillem git at videolan.org
Fri Sep 13 13:43:01 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Sep 13 11:15:36 2019 +0200| [e29c031ae88ef9c47048bcd426a404734c17b4f0] | committer: Thomas Guillem

videotoolbox: don't reset the vout when closing

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

 modules/codec/videotoolbox.m | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index f1a402ccb8..83c343fc4b 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1272,7 +1272,7 @@ static int StartVideoToolbox(decoder_t *p_dec)
     return VLC_SUCCESS;
 }
 
-static void StopVideoToolbox(decoder_t *p_dec)
+static void StopVideoToolbox(decoder_t *p_dec, bool closing)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
@@ -1290,7 +1290,7 @@ static void StopVideoToolbox(decoder_t *p_dec)
          * will reallocate frames while previous frames are still used by the
          * vout (and not released). To work-around this issue, we force a vout
          * change. */
-        if (p_dec->fmt_out.i_codec == VLC_CODEC_CVPX_BGRA
+        if (!closing && p_dec->fmt_out.i_codec == VLC_CODEC_CVPX_BGRA
          && p_dec->fmt_out.video.i_width * p_dec->fmt_out.video.i_height >= 8000000)
         {
             const video_format_t orig = p_dec->fmt_out.video;
@@ -1464,7 +1464,7 @@ static void CloseDecoder(vlc_object_t *p_this)
     decoder_t *p_dec = (decoder_t *)p_this;
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    StopVideoToolbox(p_dec);
+    StopVideoToolbox(p_dec, true);
 
     if(p_sys->pf_codec_clean)
         p_sys->pf_codec_clean(p_dec);
@@ -1845,7 +1845,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
 
                 /* Drain before stopping */
                 Drain(p_dec, false);
-                StopVideoToolbox(p_dec);
+                StopVideoToolbox(p_dec, false);
 
                 vlc_mutex_lock(&p_sys->lock);
             }
@@ -1880,7 +1880,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
             vlc_mutex_unlock(&p_sys->lock);
 
             /* Session will be started by Late Start code block */
-            StopVideoToolbox(p_dec);
+            StopVideoToolbox(p_dec, false);
 
             vlc_mutex_lock(&p_sys->lock);
             p_sys->vtsession_status = VTSESSION_STATUS_OK;
@@ -1936,7 +1936,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
             msg_Dbg(p_dec, "parameters sets changed: draining decoder");
             Drain(p_dec, false);
             msg_Dbg(p_dec, "parameters sets changed: restarting decoder");
-            StopVideoToolbox(p_dec);
+            StopVideoToolbox(p_dec, false);
         }
 
         if(!p_sys->session)



More information about the vlc-commits mailing list