Skip to content
Snippets Groups Projects
Commit beeb4a1c authored by Romain Vimont's avatar Romain Vimont Committed by Thomas Guillem
Browse files

player: add GetSelectedProgram() helper


There were helpers for retrieving the selected title, chapter or track,
but a helper for the selected program was missing.

Signed-off-by: default avatarThomas Guillem <thomas@gllm.fr>
parent 3159390d
No related branches found
No related tags found
No related merge requests found
......@@ -1965,6 +1965,24 @@ vlc_player_SelectNextProgram(vlc_player_t *player);
VLC_API void
vlc_player_SelectPrevProgram(vlc_player_t *player);
/**
* Helper to get the current selected program
*/
static inline const struct vlc_player_program *
vlc_player_GetSelectedProgram(vlc_player_t *player)
{
size_t count = vlc_player_GetProgramCount(player);
for (size_t i = 0; i < count; ++i)
{
const struct vlc_player_program *program =
vlc_player_GetProgramAt(player, i);
assert(program);
if (program->selected)
return program;
}
return NULL;
}
/**
* Check if the media has a teletext menu
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment