Skip to content

Delay in media object causes slight glitch in looped video #3

@mdejong

Description

@mdejong

This patch needs to be evaluated in terms of how it impacts looping with audio. The audio needs to stop before the next loop otherwise audio playback fails. But, the artificial delay means that there is a slight visual glitch in a looping video with no audio. This change needs to not reintroduce the problem with the audio playback.

diff --git a/Classes/AVAnimator/AVAnimatorMedia.m b/Classes/AVAnimator/AVAnimatorMedia.m
index cde252f..32a8401 100644
--- a/Classes/AVAnimator/AVAnimatorMedia.m
+++ b/Classes/AVAnimator/AVAnimatorMedia.m
@@ -631,11 +631,14 @@
NSAssert(self.currentFrame == 0, @"currentFrame must be zero");

// Schedule delayed start callback to start audio playback and kick

  • // off decode callback cycle.
  • // off decode callback cycle. This callback is scheduled so that
  • // the event loop is entered again, but note the 0.0 delay, we do
  • // not want to introduce an issue with a slight delay appearing
  • // at the end of an animation cycle.

[self.animatorDecodeTimer invalidate];

  •   self.animatorDecodeTimer = [NSTimer timerWithTimeInterval: 0.01
    
  •   self.animatorDecodeTimer = [NSTimer timerWithTimeInterval: 0.0
                                                  target: self
                                                selector: @selector(_delayedStartAnimator:)
                                                userInfo: NULL
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions