[vlc-commits] [Git][videolan/vlc][master] macosx: Stop asking to resume playback for album tracks

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Aug 20 14:12:39 UTC 2022



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
d93353a9 by Claudio Cambra at 2022-08-20T13:52:35+00:00
macosx: Stop asking to resume playback for album tracks

Signed-off-by: Claudio Cambra <claudio.cambra at gmail.com>

- - - - -


1 changed file:

- modules/gui/macosx/playlist/VLCPlaybackContinuityController.m


Changes:

=====================================
modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
=====================================
@@ -31,11 +31,13 @@
 #import "library/VLCInputItem.h"
 #import "library/VLCLibraryDataTypes.h"
 
-static const int64_t MinimumDuration = 3 * 60 * 1000;
+static const int64_t SecInMillisecs = 1000;
+static const int64_t MinInMillisecs = SecInMillisecs * 60;
+static const int64_t MinimumDuration = 3 * MinInMillisecs;
 static const float MinimumStorePercent = 0.05;
 static const float MaximumStorePercent = 0.95;
-static const int64_t MinimumStoreTime = 60 * 1000;
-static const int64_t MinimumStoreRemainingTime = 60 * 1000;
+static const int64_t MinimumStoreTime = MinInMillisecs;
+static const int64_t MinimumStoreRemainingTime = MinInMillisecs;
 static NSString *VLCRecentlyPlayedMediaKey = @"recentlyPlayedMedia";
 static NSString *VLCRecentlyPlayedMediaListKey = @"recentlyPlayedMediaList";
 
@@ -187,10 +189,16 @@ static NSString *VLCRecentlyPlayedMediaListKey = @"recentlyPlayedMediaList";
                                               ask:(BOOL)ask
                                            player:(VLCPlayerController *)playerController
 {
+    if(libraryMediaItem == nil) {
+        return;
+    }
+
     float lastPlaybackPosition = libraryMediaItem.progress;
     int64_t duration = libraryMediaItem.duration;
+    BOOL isAlbumTrack = libraryMediaItem.mediaSubType == VLC_ML_MEDIA_SUBTYPE_ALBUMTRACK;
+
+    if (lastPlaybackPosition < MinimumStorePercent || duration < MinimumDuration || isAlbumTrack) {
 
-    if (lastPlaybackPosition < MinimumStorePercent || duration < MinimumDuration) {
         return;
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d93353a9df7ee29b9d914d6a115e24ae8d3e1d77

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d93353a9df7ee29b9d914d6a115e24ae8d3e1d77
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list