Trouble setting currentAudioPlaybackDelay tvOS
Posted: 16 Jan 2016 17:51
I need to set an audio delay if on the ATV4 the user selects an alternative audio output route (other than HDMI). It's easy to find the correct delay amount using an AVAudioSession.
This code doesn't work as the audio delay does not change.
I'm using a git iOS-2.7 checkout and the video I'm playing is coming from an HDHomerun TV network tuner (mpeg2), over either UDP or TCP. Thinking perhaps it's not working because of cache size, I changed the constructor to
with no effect in fixing the problem.
Does anyone have an idea where I may be messing up? I've tried setting the delay at construction time, after the video has begun to play, and as a test with a button press event by changing the delay by a second. All attempts result in the delay not changing at all. In this mode the audio is off by 2 seconds.
Thanks for any help!!
Code: Select all
VLCMediaPlayer *mediaplayer = [[VLCMediaPlayer alloc] init];
AVAudioSession *sess = [AVAudioSession sharedInstance];
[mediaplayer setCurrentAudioPlaybackDelay:(long) ([sess outputLatency] * 1000)];
I'm using a git iOS-2.7 checkout and the video I'm playing is coming from an HDHomerun TV network tuner (mpeg2), over either UDP or TCP. Thinking perhaps it's not working because of cache size, I changed the constructor to
Code: Select all
NSMutableArray *args = [[NSMutableArray alloc] init];
[args addObject:@"--udp-caching=5000"];
[args addObject:@"--tcp-caching=5000"];
VLCMediaPlayer *mediaplayer = [[VLCMediaPlayer alloc] initWithOptions:args];
Does anyone have an idea where I may be messing up? I've tried setting the delay at construction time, after the video has begun to play, and as a test with a button press event by changing the delay by a second. All attempts result in the delay not changing at all. In this mode the audio is off by 2 seconds.
Thanks for any help!!