[vlc-commits] videotoolbox: lock p_sys->i_restart_count
Thomas Guillem
git at videolan.org
Fri Mar 9 13:41:52 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar 9 11:32:36 2018 +0100| [8accf7bbddaba294e031dea133b5c9db29257e5c] | committer: Thomas Guillem
videotoolbox: lock p_sys->i_restart_count
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8accf7bbddaba294e031dea133b5c9db29257e5c
---
modules/codec/videotoolbox.m | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index c8b806f5ce..9f16c7a104 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1772,7 +1772,6 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
case kVTVideoDecoderBadDataErr:
case kVTInvalidSessionErr:
*p_vtsession_status = VTSESSION_STATUS_RESTART;
- p_sys->i_restart_count++;
break;
default:
*p_vtsession_status = VTSESSION_STATUS_OK;
@@ -1985,6 +1984,8 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
else
{
vlc_mutex_lock(&p_sys->lock);
+ if (vtsession_status == VTSESSION_STATUS_RESTART)
+ p_sys->i_restart_count++;
p_sys->vtsession_status = vtsession_status;
/* In case of abort, the decoder module will be reloaded next time
* since we already modified the input block */
@@ -2145,7 +2146,11 @@ static void DecoderCallback(void *decompressionOutputRefCon,
if (HandleVTStatus(p_dec, status, &vtsession_status) != VLC_SUCCESS)
{
if (p_sys->vtsession_status != VTSESSION_STATUS_ABORT)
+ {
p_sys->vtsession_status = vtsession_status;
+ if (vtsession_status == VTSESSION_STATUS_RESTART)
+ p_sys->i_restart_count++;
+ }
goto end;
}
if (unlikely(!imageBuffer))
More information about the vlc-commits
mailing list