[vlc-commits] codec/videotoolbox: Fix uninitialized pts in late start case

Marvin Scholz git at videolan.org
Mon Jul 29 12:19:59 CEST 2019


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sun Jul 28 13:13:12 2019 +0200| [b80f75f8318f5ebc5629a526931d77a82e83860e] | committer: Marvin Scholz

codec/videotoolbox: Fix uninitialized pts in late start case

(cherry picked from commit 14f5f65d612bcb6e8e61223e818ebc84b11103b5)

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

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

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 89855d692d..12246c18fe 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1287,8 +1287,6 @@ static int StartVideoToolbox(decoder_t *p_dec)
     if (HandleVTStatus(p_dec, status, NULL) != VLC_SUCCESS)
         return VLC_EGENERIC;
 
-    PtsInit(p_dec);
-
     return VLC_SUCCESS;
 }
 
@@ -1461,11 +1459,14 @@ static int OpenDecoder(vlc_object_t *p_this)
     }
 
     int i_ret = StartVideoToolbox(p_dec);
-    if (i_ret == VLC_SUCCESS)
+    if (i_ret == VLC_SUCCESS) {
+        PtsInit(p_dec);
         msg_Info(p_dec, "Using Video Toolbox to decode '%4.4s'",
                         (char *)&p_dec->fmt_in.i_codec);
-    else
+    } else {
         CloseDecoder(p_this);
+    }
+
     return i_ret;
 }
 



More information about the vlc-commits mailing list