[vlc-devel] [PATCH] player: input: Store tracks presence in the ml struct
Francois Cartegnie
fcvlcdev at free.fr
Thu Sep 17 16:48:06 CEST 2020
Le 17/09/2020 à 16:30, Hugo Beauzée-Luyssen a écrit :
> In order to be able to probe the media type after it is stopped and its
> track vectors have been emptied.
> ---
> src/player/input.c | 5 +++++
> src/player/medialib.c | 4 ++--
> src/player/player.h | 5 +++++
> 3 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/src/player/input.c b/src/player/input.c
> index 59b4f7345d..5e6913734e 100644
> --- a/src/player/input.c
> +++ b/src/player/input.c
> @@ -498,6 +498,10 @@ vlc_player_input_HandleEsEvent(struct vlc_player_input *input,
> if (!trackpriv)
> break;
>
> + if (!input->ml.has_video_tracks && ev->fmt->i_cat == VIDEO_ES)
> + input->ml.has_video_tracks = true;
> + else if (!input->ml.has_audio_tracks && ev->fmt->i_cat == AUDIO_ES)
> + input->ml.has_audio_tracks = true;
what about something more generic like
trackavailbits |= (1 << (ev->fmt->i_cat));
--
Francois Cartegnie
VideoLAN - VLC Developer
More information about the vlc-devel
mailing list