Trouble setting currentAudioPlaybackDelay tvOS

iOS, iPad, iPhone, tvOS specific usage questions
jflicks
New Cone
New Cone
Posts: 2
Joined: 16 Jan 2016 17:33

Trouble setting currentAudioPlaybackDelay tvOS

Postby jflicks » 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.

Code: Select all

VLCMediaPlayer *mediaplayer = [[VLCMediaPlayer alloc] init]; AVAudioSession *sess = [AVAudioSession sharedInstance]; [mediaplayer setCurrentAudioPlaybackDelay:(long) ([sess outputLatency] * 1000)];
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

Code: Select all

NSMutableArray *args = [[NSMutableArray alloc] init]; [args addObject:@"--udp-caching=5000"]; [args addObject:@"--tcp-caching=5000"]; VLCMediaPlayer *mediaplayer = [[VLCMediaPlayer alloc] initWithOptions:args];
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!!

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: Trouble setting currentAudioPlaybackDelay tvOS

Postby fkuehne » 16 Jan 2016 18:11

This should do:

Code: Select all

mediaPlayer.currentAudioPlaybackDelay = 1000000.*[[AVAudioSession sharedInstance] outputLatency];
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jflicks
New Cone
New Cone
Posts: 2
Joined: 16 Jan 2016 17:33

Re: Trouble setting currentAudioPlaybackDelay tvOS

Postby jflicks » 16 Jan 2016 21:21

Thank you for the suggestion, as it looks like I was quite a bit off! I tried it and it all still behaves the same. It looks like the setting is just being ignored for some reason.


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 15 guests