[vlc-devel] [PATCH] player: input: Store tracks presence in the ml struct

Rémi Denis-Courmont remi at remlab.net
Thu Sep 17 21:10:08 CEST 2020


Le torstaina 17. syyskuuta 2020, 21.31.09 EEST Alexandre Janniaux a écrit :
> It could be suggested to use no if condition for that:
> 
>         input->ml.has_video_tracks |= !input->ml.has_video_tracks
>                                    && ev->fmt->i_cat == VIDEO_ES;
>         input->ml.has_audio_tracks |= !input->ml.has_audio_tracks
>                                    && ev->fmt->i_cat == AUDIO_ES)

This is using the *bit-wise* disjunction operator for what is semantically a 
*logical* disjunction. It works, but I can't say that it would be particularly 
pretty.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list