Explorar o código

VLCMediaPlayer: expand the API by adding setter/getter for SPU delay

Felix Paul Kühne %!s(int64=12) %!d(string=hai) anos
pai
achega
b16ede5cc8
Modificáronse 2 ficheiros con 18 adicións e 0 borrados
  1. 8 0
      Headers/Public/VLCMediaPlayer.h
  2. 10 0
      Sources/VLCMediaPlayer.m

+ 8 - 0
Headers/Public/VLCMediaPlayer.h

@@ -208,6 +208,14 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
 - (BOOL)openVideoSubTitlesFromFile:(NSString *)path;
 
 /**
+ * Get the current subtitle delay. Positive values means subtitles are being
+ * displayed later, negative values earlier.
+ *
+ * \return time (in microseconds) the display of subtitles is being delayed
+ */
+@property (readwrite) NSInteger currentVideoSubTitleDelay;
+
+/**
  * Chapter selection and enumeration, it is bound
  * to a title option.
  */

+ 10 - 0
Sources/VLCMediaPlayer.m

@@ -343,6 +343,16 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
     return [NSArray arrayWithArray: tempArray];
 }
 
+- (void)setCurrentVideoSubTitleDelay:(NSInteger)index
+{
+    libvlc_video_set_spu_delay(instance, index);
+}
+
+- (NSInteger)currentVideoSubTitleDelay
+{
+    return libvlc_video_get_spu_delay(instance);
+}
+
 
 #pragma mark -
 #pragma mark Video Crop geometry