Parcourir la source

VLCTrackSelectorView: avoid using current title if not selected

Alexandre Janniaux il y a 5 ans
Parent
commit
8cb6557d15
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      Sources/VLCTrackSelectorView.m

+ 3 - 2
Sources/VLCTrackSelectorView.m

@@ -96,8 +96,9 @@
         if ([playbackController numberOfTitles] > 1)
             sections++;
 
-        if ([playbackController numberOfChaptersForCurrentTitle] > 1)
-            sections++;
+        if (playbackController.indexOfCurrentTitle >= 0)
+            if ([playbackController numberOfChaptersForCurrentTitle] > 1)
+                sections++;
     }
 
     return sections;