[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Remove unused setCurrentMedia in player controller

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Dec 16 08:21:48 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
262223a7 by Claudio Cambra at 2024-12-16T08:07:37+00:00
macosx: Remove unused setCurrentMedia in player controller

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
d9f406b4 by Claudio Cambra at 2024-12-16T08:07:37+00:00
macosx: Do not re-create input item on every access of VLCPlayerController.currentMedia

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


2 changed files:

- modules/gui/macosx/playqueue/VLCPlayerController.h
- modules/gui/macosx/playqueue/VLCPlayerController.m


Changes:

=====================================
modules/gui/macosx/playqueue/VLCPlayerController.h
=====================================
@@ -317,12 +317,6 @@ extern const CGFloat VLCVolumeDefault;
  * @note it is the receiver's obligation to release the input item
  */
 @property (readonly, nullable) VLCInputItem * currentMedia;
-/**
- * set the current media item
- * @note this is typically done by the associated playlist so you should not need to do it
- * @return VLC_SUCCESS on success, another VLC error on failure
- */
-- (int)setCurrentMedia:(VLCInputItem *)currentMedia;
 
 /**
  * returns the duration of the current media in vlc ticks


=====================================
modules/gui/macosx/playqueue/VLCPlayerController.m
=====================================
@@ -739,34 +739,10 @@ static int BossCallback(vlc_object_t *p_this,
 
 #pragma mark - player callback delegations
 
-- (VLCInputItem *)currentMedia
-{
-    VLCInputItem *inputItem;
-    input_item_t *p_input;
-    vlc_player_Lock(_p_player);
-    p_input = vlc_player_GetCurrentMedia(_p_player);
-    if (p_input) {
-        inputItem = [[VLCInputItem alloc] initWithInputItem:p_input];
-    }
-    vlc_player_Unlock(_p_player);
-    return inputItem;
-}
-
-- (int)setCurrentMedia:(VLCInputItem *)currentMedia
-{
-    if (currentMedia == NULL) {
-        return VLC_ENOENT;
-    }
-    vlc_player_Lock(_p_player);
-    int ret = vlc_player_SetCurrentMedia(_p_player, currentMedia.vlcInputItem);
-    vlc_player_Unlock(_p_player);
-    return ret;
-}
-
 - (void)currentMediaItemChanged:(input_item_t *)newMediaItem
 {
-    [_defaultNotificationCenter postNotificationName:VLCPlayerCurrentMediaItemChanged
-                                              object:self];
+    _currentMedia = [[VLCInputItem alloc] initWithInputItem:newMediaItem];
+    [_defaultNotificationCenter postNotificationName:VLCPlayerCurrentMediaItemChanged object:self];
 }
 
 - (vlc_tick_t)durationOfCurrentMediaItem



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/fc986201634c7f3f9dc1560c807d8d14b2e3fbed...d9f406b4d9a819385cf92d5dd2ac11f57bb7fd97

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/fc986201634c7f3f9dc1560c807d8d14b2e3fbed...d9f406b4d9a819385cf92d5dd2ac11f57bb7fd97
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