ソースを参照

VLCMetadata: checkIsAudioOnly: Use numberOfVideoTracks

Soomin Lee 6 年 前
コミット
e5baf8ce32
1 ファイル変更1 行追加14 行削除
  1. 1 14
      SharedSources/VLCMetadata.m

+ 1 - 14
SharedSources/VLCMetadata.m

@@ -90,20 +90,7 @@
 
 - (void)checkIsAudioOnly:(VLCMediaPlayer *)mediaPlayer
 {
-    if (!self.isAudioOnly) {
-        /* either what we are playing is not a file known to MLKit or
-         * MLKit fails to acknowledge that it is audio-only.
-         * Either way, do a more expensive check to see if it is really audio-only */
-        NSArray *tracks = mediaPlayer.media.tracksInformation;
-        NSUInteger trackCount = tracks.count;
-        self.isAudioOnly = YES;
-        for (NSUInteger x = 0 ; x < trackCount; x++) {
-            if ([[tracks[x] objectForKey:VLCMediaTracksInformationType] isEqualToString:VLCMediaTracksInformationTypeVideo]) {
-                self.isAudioOnly = NO;
-                break;
-            }
-        }
-    }
+    _isAudioOnly = mediaPlayer.numberOfVideoTracks == 0;
 }
 
 - (void)fillFromMetaDict:(VLCMediaPlayer *)mediaPlayer