Commit b9deb79a authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Soomin Lee

media player: don't crash if the optional recording protocol is not implemented (fixes #237)

(cherry picked from commit 4a5db98b)
Signed-off-by: Soomin Lee's avatarSoomin Lee <bubu@mikan.io>
parent 85ed00e3
...@@ -1556,8 +1556,15 @@ static void HandleMediaPlayerRecord(const libvlc_event_t * event, void * self) ...@@ -1556,8 +1556,15 @@ static void HandleMediaPlayerRecord(const libvlc_event_t * event, void * self)
NSString *filePath = arguments.firstObject[@"filePath"]; NSString *filePath = arguments.firstObject[@"filePath"];
BOOL isRecording = [arguments.firstObject[@"isRecording"] boolValue]; BOOL isRecording = [arguments.firstObject[@"isRecording"] boolValue];
isRecording ? [_delegate mediaPlayerStartedRecording:self] if (isRecording) {
: [_delegate mediaPlayer:self recordingStoppedAtPath:filePath]; if ([(NSObject *)_delegate respondsToSelector:@selector(mediaPlayerStartedRecording:)]) {
[_delegate mediaPlayerStartedRecording:self];
}
} else {
if ([(NSObject *)_delegate respondsToSelector:@selector(mediaPlayer:recordingStoppedAtPath:)]) {
[self.delegate mediaPlayer:self recordingStoppedAtPath:filePath];
}
}
} }
@end @end
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