[vlc-commits] player: refactor track research from id
Thomas Guillem
git at videolan.org
Thu Jun 20 10:22:39 CEST 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jun 14 11:57:54 2019 +0200| [d77c0d532e35bfee44d35697edaf3262de233526] | committer: Thomas Guillem
player: refactor track research from id
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d77c0d532e35bfee44d35697edaf3262de233526
---
src/input/player.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/input/player.c b/src/input/player.c
index 2405f4b084..b37fd8aa2e 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -1259,6 +1259,15 @@ vlc_player_track_vector_FindById(vlc_player_track_vector *vec, vlc_es_id_t *id,
return NULL;
}
+static struct vlc_player_track_priv *
+vlc_player_input_FindTrackById(struct vlc_player_input *input, vlc_es_id_t *id,
+ size_t *idx)
+{
+ vlc_player_track_vector *vec =
+ vlc_player_input_GetTrackVector(input, vlc_es_id_GetCat(id));
+ return vec ? vlc_player_track_vector_FindById(vec, id, idx) : NULL;
+}
+
size_t
vlc_player_GetTrackCount(vlc_player_t *player, enum es_format_category_e cat)
{
@@ -1898,10 +1907,8 @@ vlc_player_input_HandleVoutEvent(struct vlc_player_input *input,
vlc_player_t *player = input->player;
- vlc_player_track_vector *vec =
- vlc_player_input_GetTrackVector(input, vlc_es_id_GetCat(ev->id));
struct vlc_player_track_priv *trackpriv =
- vec ? vlc_player_track_vector_FindById(vec, ev->id, NULL) : NULL;
+ vlc_player_input_FindTrackById(input, ev->id, NULL);
if (!trackpriv)
return;
More information about the vlc-commits
mailing list