Pārlūkot izejas kodu

VLCMediaPlayer: Change the return values of methods to unify it with libvlc

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 gadi atpakaļ
vecāks
revīzija
2da709acf6
2 mainītis faili ar 13 papildinājumiem un 5 dzēšanām
  1. 8 0
      NEWS
  2. 5 5
      Sources/VLCMediaPlayer.m

+ 8 - 0
NEWS

@@ -36,6 +36,14 @@ New APIs:
   - Note:
     - play's return type was changed from BOOL to void
     - hue is now a float instead of an integer
+  - WARNING:
+    - Return value of the following methods changed from INT_MAX to -1
+      (int)currentVideoTrackIndex
+      (int)currentVideoSubTitleIndex
+      (int)currentChapterIndex
+      (int)currentTitleIndex
+      (int)currentAudioTrackIndex
+
 
 - VLCMedia
   - added keys: VLCMetaInformationTrackTotal, VLCMetaInformationDirector,

+ 5 - 5
Sources/VLCMediaPlayer.m

@@ -367,7 +367,7 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
 {
     int count = libvlc_video_get_track_count(_playerInstance);
     if (count <= 0)
-        return INT_MAX;
+        return -1;
 
     return libvlc_video_get_track(_playerInstance);
 }
@@ -426,7 +426,7 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
     NSInteger count = libvlc_video_get_spu_count(_playerInstance);
 
     if (count <= 0)
-        return INT_MAX;
+        return -1;
 
     return libvlc_video_get_spu(_playerInstance);
 }
@@ -702,7 +702,7 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
 {
     int count = libvlc_media_player_get_chapter_count(_playerInstance);
     if (count <= 0)
-        return INT_MAX;
+        return -1;
     int result = libvlc_media_player_get_chapter(_playerInstance);
     return result;
 }
@@ -750,7 +750,7 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
 {
     NSInteger count = libvlc_media_player_get_title_count(_playerInstance);
     if (count <= 0)
-        return INT_MAX;
+        return -1;
 
     return libvlc_media_player_get_title(_playerInstance);
 }
@@ -897,7 +897,7 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
 {
     NSInteger count = libvlc_audio_get_track_count(_playerInstance);
     if (count <= 0)
-        return INT_MAX;
+        return -1;
 
     return libvlc_audio_get_track(_playerInstance);
 }