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