From e1133d81576ec0785f7881553976a7182b9f49f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
Date: Sat, 20 Aug 2022 21:36:20 +0200
Subject: [PATCH] VLCMediaPlayer: adapt record API to mainline

---
 Headers/Public/VLCMediaPlayer.h |  6 ++----
 Sources/VLCMediaPlayer.m        | 10 +++++-----
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/Headers/Public/VLCMediaPlayer.h b/Headers/Public/VLCMediaPlayer.h
index 7d271186..2d28300a 100644
--- a/Headers/Public/VLCMediaPlayer.h
+++ b/Headers/Public/VLCMediaPlayer.h
@@ -799,15 +799,13 @@ NSString *const VLCTitleDescriptionIsMenu;
 /**
  * Start recording at given **directory** path
  * \param path directory where the recording should go
- * \return an BOOL with the success status
  */
-- (BOOL)startRecordingAtPath:(NSString *)path;
+- (void)startRecordingAtPath:(NSString *)path;
 
 /**
  * Stop current recording
- * \return an BOOL with the success status
  */
-- (BOOL)stopRecording;
+- (void)stopRecording;
 
 #pragma mark -
 #pragma mark Renderer
diff --git a/Sources/VLCMediaPlayer.m b/Sources/VLCMediaPlayer.m
index 70a4c5da..99decfad 100644
--- a/Sources/VLCMediaPlayer.m
+++ b/Sources/VLCMediaPlayer.m
@@ -258,7 +258,7 @@ static void HandleMediaPlayerRecord(const libvlc_event_t * event, void * self)
         VLCMediaPlayer *mediaPlayer = (__bridge VLCMediaPlayer *)self;
         NSArray *arg = @[
             @{
-                @"filePath": [NSString stringWithFormat:@"%s", event->u.media_player_record_changed.file_path],
+                @"filePath": [NSString stringWithFormat:@"%s", event->u.media_player_record_changed.recorded_file_path],
                 @"isRecording": @(event->u.media_player_record_changed.recording)
             }
         ];
@@ -1179,14 +1179,14 @@ static void HandleMediaPlayerRecord(const libvlc_event_t * event, void * self)
     return _playerInstance;
 }
 
-- (BOOL)startRecordingAtPath:(NSString *)path
+- (void)startRecordingAtPath:(NSString *)path
 {
-    return libvlc_media_player_record(_playerInstance, YES, [path UTF8String]);
+    libvlc_media_player_record(_playerInstance, YES, [path UTF8String]);
 }
 
-- (BOOL)stopRecording
+- (void)stopRecording
 {
-    return libvlc_media_player_record(_playerInstance, NO, nil);
+    libvlc_media_player_record(_playerInstance, NO, nil);
 }
 
 
-- 
GitLab