[vlc-commits] videotoolbox: remove VTSESSION_STATUS_RESTART_DECAGAIN
Thomas Guillem
git at videolan.org
Fri Jan 12 09:48:39 CET 2018
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 8 13:13:39 2018 +0100| [212d2fe543dde569880be4190d2fb4cc0c5dda5a] | committer: Thomas Guillem
videotoolbox: remove VTSESSION_STATUS_RESTART_DECAGAIN
Use VTSESSION_STATUS_RESTART instead, never send twice the same data if it
failed.
(cherry picked from commit cb79849e1acfcc747e2d0d031a4b82fa430aa75f)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=212d2fe543dde569880be4190d2fb4cc0c5dda5a
---
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