Commit 3ce6fa1a authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

AspenProject: handle cancelled action sheets correctly

parent 75c3da60
...@@ -157,16 +157,18 @@ ...@@ -157,16 +157,18 @@
if (actionSheet == _subtitleActionSheet) { if (actionSheet == _subtitleActionSheet) {
namesArray = _mediaPlayer.videoSubTitlesNames; namesArray = _mediaPlayer.videoSubTitlesNames;
arrayIndex = [namesArray indexOfObject:[actionSheet buttonTitleAtIndex:buttonIndex]]; arrayIndex = [namesArray indexOfObject:[actionSheet buttonTitleAtIndex:buttonIndex]];
indexArray = _mediaPlayer.videoSubTitlesIndexes; if (arrayIndex != NSNotFound) {
_mediaPlayer.currentVideoSubTitleIndex = [[indexArray objectAtIndex:arrayIndex] intValue]; indexArray = _mediaPlayer.videoSubTitlesIndexes;
_mediaPlayer.currentVideoSubTitleIndex = [[indexArray objectAtIndex:arrayIndex] intValue];
}
[_subtitleActionSheet release]; [_subtitleActionSheet release];
} else { } else {
namesArray = _mediaPlayer.audioTrackNames; namesArray = _mediaPlayer.audioTrackNames;
arrayIndex = [namesArray indexOfObject:[actionSheet buttonTitleAtIndex:buttonIndex]]; arrayIndex = [namesArray indexOfObject:[actionSheet buttonTitleAtIndex:buttonIndex]];
indexArray = _mediaPlayer.audioTrackIndexes; if (arrayIndex != NSNotFound) {
APLog(@"audio index to be set %i", [[indexArray objectAtIndex:arrayIndex] intValue]); indexArray = _mediaPlayer.audioTrackIndexes;
_mediaPlayer.currentAudioTrackIndex = [[indexArray objectAtIndex:arrayIndex] intValue]; _mediaPlayer.currentAudioTrackIndex = [[indexArray objectAtIndex:arrayIndex] intValue];
APLog(@"actual audio track index: %i", _mediaPlayer.currentAudioTrackIndex); }
[_audiotrackActionSheet release]; [_audiotrackActionSheet release];
} }
} }
......
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