Fix secondary subtitles cycling
Hey,
Had some issues on selecting secondary subtitles, when cycling it would change the primary and I was not able to always cycle through all subtitles.
After looking at it my understanding is that the trackpriv->vout_order is not set when selecting the subtitle.
Then the next time we cycle through the check fail since all selected subtitles still have a VLC_VOUT_ORDER_NONE.
Solution I tested is to add the vlc_vout_order in vlc_input_event_es.
To limit code modification I decided to go with a convention that the es_id_list list produced in hotkeys.c/CycleSecondarySubtitles will be ordered with primary then secondary sub (This mean that when trying to select a secondary sub it will first select a primary sub then cycle through secondary).
Additional modifications in CycleSecondarySubtitles are:
- When first checking all subtitle store the
cycle_indexinstead of the id to prevent having to find it later on. - Break out of the Selected Search loop when we have found two selected subtitles.
- When looping to search the next track add a modulo to be able to start from index 0.