Commit 3b85ec45 authored by Carola's avatar Carola
Browse files

VLCPlaybackController: remove state for _playbackFailed

parent 8a138512
Pipeline #224 passed with stage
in 0 seconds
...@@ -48,7 +48,6 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate> ...@@ -48,7 +48,6 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
{ {
VLCRemoteControlService *_remoteControlService; VLCRemoteControlService *_remoteControlService;
BOOL _playerIsSetup; BOOL _playerIsSetup;
BOOL _playbackFailed;
BOOL _shouldResumePlaying; BOOL _shouldResumePlaying;
BOOL _sessionWillRestart; BOOL _sessionWillRestart;
BOOL _shouldResumePlayingAfterInteruption; BOOL _shouldResumePlayingAfterInteruption;
...@@ -292,7 +291,7 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate> ...@@ -292,7 +291,7 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
_playerIsSetup = NO; _playerIsSetup = NO;
[_shuffleStack removeAllObjects]; [_shuffleStack removeAllObjects];
if (_errorCallback && _playbackFailed && !_sessionWillRestart) if (_errorCallback && _mediaPlayer.state == VLCMediaPlayerStateError && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_errorCallback]; [[UIApplication sharedApplication] openURL:_errorCallback];
else if (_successCallback && !_sessionWillRestart) else if (_successCallback && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_successCallback]; [[UIApplication sharedApplication] openURL:_successCallback];
...@@ -301,9 +300,7 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate> ...@@ -301,9 +300,7 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
_activeSession = NO; _activeSession = NO;
[_playbackSessionManagementLock unlock]; [_playbackSessionManagementLock unlock];
if (_playbackFailed) { if (!_sessionWillRestart) {
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidFail object:self];
} else if (!_sessionWillRestart) {
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidStop object:self]; [[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidStop object:self];
} else { } else {
_sessionWillRestart = NO; _sessionWillRestart = NO;
...@@ -501,7 +498,9 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate> ...@@ -501,7 +498,9 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
[_mediaPlayer performSelector:@selector(setTextRendererFontForceBold:) withObject:[defaults objectForKey:kVLCSettingSubtitlesBoldFont]]; [_mediaPlayer performSelector:@selector(setTextRendererFontForceBold:) withObject:[defaults objectForKey:kVLCSettingSubtitlesBoldFont]];
} else if (currentState == VLCMediaPlayerStateError) { } else if (currentState == VLCMediaPlayerStateError) {
APLog(@"Playback failed"); APLog(@"Playback failed");
_playbackFailed = YES; dispatch_async(dispatch_get_main_queue(),^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidFail object:self];
});
_sessionWillRestart = NO; _sessionWillRestart = NO;
[self stopPlayback]; [self stopPlayback];
} else if (currentState == VLCMediaPlayerStateEnded || currentState == VLCMediaPlayerStateStopped) { } else if (currentState == VLCMediaPlayerStateEnded || currentState == VLCMediaPlayerStateStopped) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment