[vlc-commits] videotoolbox: don't ignore StartVideoToolbox() return

Thomas Guillem git at videolan.org
Wed Dec 13 16:18:38 CET 2017


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Dec 13 15:51:36 2017 +0100| [99b7d9072b2371e4b5dc09e1f5f81ba294d799b9] | committer: Thomas Guillem

videotoolbox: don't ignore StartVideoToolbox() return

And abort if the vtsession can't handle a profile/level.

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

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

 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 6c8420250b..1134a1e554 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1849,11 +1849,8 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
 
         if(!p_sys->session)
         {
-            if(!p_sys->pf_codec_supported || p_sys->pf_codec_supported(p_dec))
-            {
-                StartVideoToolbox(p_dec);
-            }
-            else
+            if ((p_sys->pf_codec_supported && !p_sys->pf_codec_supported(p_dec))
+              || StartVideoToolbox(p_dec) != VLC_SUCCESS)
             {
                 /* The current device doesn't handle the profile/level, abort */
                 vlc_mutex_lock(&p_sys->lock);



More information about the vlc-commits mailing list