[vlc-commits] videotoolbox: remove VTSESSION_STATUS_RESTART_DECAGAIN

Thomas Guillem git at videolan.org
Tue Jan 9 18:19:47 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan  8 13:13:39 2018 +0100| [cb79849e1acfcc747e2d0d031a4b82fa430aa75f] | committer: Thomas Guillem

videotoolbox: remove VTSESSION_STATUS_RESTART_DECAGAIN

Use VTSESSION_STATUS_RESTART instead, never send twice the same data if it
failed.

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

 modules/codec/videotoolbox.m | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 1920e382b8..1537f5abeb 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -102,7 +102,6 @@ enum vtsession_status
 {
     VTSESSION_STATUS_OK,
     VTSESSION_STATUS_RESTART,
-    VTSESSION_STATUS_RESTART_DECAGAIN,
     VTSESSION_STATUS_ABORT,
 };
 
@@ -1714,8 +1713,6 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
                 break;
             case -8969 /* codecBadDataErr */:
             case kVTVideoDecoderBadDataErr:
-                *p_vtsession_status = VTSESSION_STATUS_RESTART_DECAGAIN;
-                break;
             case kVTInvalidSessionErr:
                 *p_vtsession_status = VTSESSION_STATUS_RESTART;
                 break;
@@ -1891,22 +1888,9 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
     }
     else
     {
-        if (vtsession_status == VTSESSION_STATUS_RESTART
-         || vtsession_status == VTSESSION_STATUS_RESTART_DECAGAIN)
+        if (vtsession_status == VTSESSION_STATUS_RESTART)
         {
             int ret = RestartVideoToolbox(p_dec, true);
-            if (ret == VLC_SUCCESS
-             && vtsession_status == VTSESSION_STATUS_RESTART_DECAGAIN)
-            {
-                /* Duplicate p_info since it is or will be freed by the
-                 * Decoder Callback */
-                p_info = CreateReorderInfo(p_dec, p_block);
-                if (likely(p_info))
-                    status = VTDecompressionSessionDecodeFrame(p_sys->session,
-                                    sampleBuffer, decoderFlags, p_info, &flagOut);
-                if (status != 0)
-                    ret = VLC_EGENERIC;
-            }
             if (ret != VLC_SUCCESS) /* restart failed, abort */
                 vtsession_status = VTSESSION_STATUS_ABORT;
         }
@@ -2051,10 +2035,6 @@ static void DecoderCallback(void *decompressionOutputRefCon,
     enum vtsession_status vtsession_status;
     if (HandleVTStatus(p_dec, status, &vtsession_status) != VLC_SUCCESS)
     {
-        /* Can't decode again from here */
-        if (vtsession_status == VTSESSION_STATUS_RESTART_DECAGAIN)
-            vtsession_status = VTSESSION_STATUS_RESTART;
-
         if (p_sys->vtsession_status != VTSESSION_STATUS_ABORT)
             p_sys->vtsession_status = vtsession_status;
         goto end;



More information about the vlc-commits mailing list