Parcourir la source

VLCMediaPlayer: use sharedLibrary if no options are given and only create a new library instance if we have to

Felix Paul Kühne il y a 12 ans
Parent
commit
245b7c1b38
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      Sources/VLCMediaPlayer.m

+ 4 - 1
Sources/VLCMediaPlayer.m

@@ -978,7 +978,10 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
         // Create a media instance, it doesn't matter what library we start off with
         // it will change depending on the media descriptor provided to the media
         // instance
-        _privateLibrary = [VLCLibrary sharedLibrary];
+        if (options && options.count > 0)
+            _privateLibrary = [[VLCLibrary alloc] initWithOptions:options];
+        else
+            _privateLibrary = [VLCLibrary sharedLibrary];
         _playerInstance = libvlc_media_player_new([_privateLibrary instance]);
 
         [self registerObservers];