[vlc-commits] [Git][videolan/vlc][master] esout: prioritize forced ES in default selection
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jan 31 14:06:10 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
822b0917 by Alaric Senat at 2025-01-31T13:51:15+00:00
esout: prioritize forced ES in default selection
Whenever an ES selection is forced, the algorithm taking care of default
selecting the tracks at ES creation should take it into account.
Otherwise, tracks with highest priority will always be selected when
created after an user selected one. This happens a lot in DVDs since PS
sets track priority.
Fixes #24815
- - - - -
1 changed file:
- src/input/es_out.c
Changes:
=====================================
src/input/es_out.c
=====================================
@@ -136,6 +136,7 @@ struct es_out_id_t
char *psz_language_code;
char *psz_title;
bool b_terminated;
+ bool forced;
vlc_input_decoder_t *p_dec;
vlc_input_decoder_t *p_dec_record;
@@ -2188,6 +2189,7 @@ static es_out_id_t *EsOutAddLocked(es_out_sys_t *p_sys,
es->b_scrambled = false;
es->b_terminated = false;
+ es->forced = false;
switch( es->fmt.i_cat )
{
@@ -2539,6 +2541,7 @@ static void EsOutUnselectEs(es_out_sys_t *p_sys, es_out_id_t *es, bool b_update)
EsOutStopNextFrame(p_sys);
EsOutDestroyDecoder(p_sys, es);
+ es->forced = false;
if( !b_update )
return;
@@ -2551,7 +2554,10 @@ static bool EsOutSelectMatchPrioritized( const es_out_es_props_t *p_esprops,
const es_out_id_t *es )
{
if( p_esprops->p_main_es != NULL )
- return es->fmt.i_priority > p_esprops->p_main_es->fmt.i_priority;
+ {
+ return !p_esprops->p_main_es->forced &&
+ es->fmt.i_priority > p_esprops->p_main_es->fmt.i_priority;
+ }
return es->fmt.i_priority > ES_PRIORITY_NOT_DEFAULTABLE;
}
@@ -2733,6 +2739,9 @@ static void EsOutSelect(es_out_sys_t *p_sys, es_out_id_t *es, bool b_force)
}
}
+ if( b_force )
+ es->forced = true;
+
/* FIXME TODO handle priority here */
if( p_esprops && p_sys->i_mode == ES_OUT_MODE_AUTO && EsIsSelected( es ) )
p_esprops->p_main_es = es;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/822b0917ef68d87f9215163ea2ad9251642f3929
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/822b0917ef68d87f9215163ea2ad9251642f3929
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list