[vlc-commits] player: No need to pass the item to vlc_player_input_RestoreMlStates

Hugo Beauzée-Luyssen git at videolan.org
Thu Jan 23 10:05:20 CET 2020


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Nov 28 16:50:06 2019 +0100| [28687fa2257a293f9e94f8f8cb6adadd79297982] | committer: Hugo Beauzée-Luyssen

player: No need to pass the item to vlc_player_input_RestoreMlStates

As it's already contained in the player input

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28687fa2257a293f9e94f8f8cb6adadd79297982
---

 src/player/input.c    | 2 +-
 src/player/medialib.c | 4 ++--
 src/player/player.h   | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/player/input.c b/src/player/input.c
index a4d8407e24..26e669007b 100644
--- a/src/player/input.c
+++ b/src/player/input.c
@@ -889,7 +889,7 @@ vlc_player_input_New(vlc_player_t *player, input_item_t *item)
         return NULL;
     }
 
-    vlc_player_input_RestoreMlStates(input, item);
+    vlc_player_input_RestoreMlStates(input);
 
     /* Initial sub/audio delay */
     const vlc_tick_t cat_delays[DATA_ES] = {
diff --git a/src/player/medialib.c b/src/player/medialib.c
index 27f51b6970..722f27bcd8 100644
--- a/src/player/medialib.c
+++ b/src/player/medialib.c
@@ -27,8 +27,7 @@
 #include "misc/variables.h"
 
 void
-vlc_player_input_RestoreMlStates(struct vlc_player_input* input,
-                                 const input_item_t* item)
+vlc_player_input_RestoreMlStates(struct vlc_player_input* input)
 {
     vlc_player_t* player = input->player;
     vlc_player_assert_locked(player);
@@ -36,6 +35,7 @@ vlc_player_input_RestoreMlStates(struct vlc_player_input* input,
     vlc_medialibrary_t* ml = vlc_ml_instance_get(input->player);
     if (!ml)
         return;
+    input_item_t* item = input_GetItem(input->thread);
     vlc_ml_media_t* media = vlc_ml_get_media_by_mrl( ml, item->psz_uri);
     if (!media || media->i_type != VLC_ML_MEDIA_TYPE_VIDEO)
         return;
diff --git a/src/player/player.h b/src/player/player.h
index 2bdda0c926..386fed1c5b 100644
--- a/src/player/player.h
+++ b/src/player/player.h
@@ -491,8 +491,7 @@ vlc_player_osd_Program(vlc_player_t *player, const char *name);
  */
 
 void
-vlc_player_input_RestoreMlStates(struct vlc_player_input* input,
-                                 const input_item_t* item);
+vlc_player_input_RestoreMlStates(struct vlc_player_input* input);
 
 void
 vlc_player_UpdateMLStates(vlc_player_t *player, struct vlc_player_input* input);



More information about the vlc-commits mailing list