[vlc-devel] [PATCH] Correctly check the index in the pref. list when selecting the ES.

Denis Charmet typx at dinauz.org
Mon Sep 30 15:06:00 CEST 2013


The former check wasn't enough since a language that isn't in the table
has a -1 index.

Fix #9531
---
 src/input/es_out.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 68acf5e..b9069a4 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1772,7 +1772,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
                         LanguageArrayIndex( p_sys->ppsz_audio_language,
                                             p_sys->p_es_audio->psz_language_code );
                     if( es_idx >= 0 &&
-                        ( es_idx < selected_es_idx ||
+                        ( selected_es_idx < 0 || es_idx < selected_es_idx ||
                           ( es_idx == selected_es_idx &&
                             p_sys->p_es_audio->fmt.i_priority < es->fmt.i_priority ) ) )
                         i_wanted = es->i_channel;
@@ -1823,7 +1823,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
                                             p_sys->p_es_sub->psz_language_code );
 
                     if( es_idx >= 0 &&
-                        ( es_idx < selected_es_idx ||
+                        ( selected_es_idx < 0 || es_idx < selected_es_idx ||
                           ( es_idx == selected_es_idx &&
                             p_sys->p_es_sub->fmt.i_priority < es->fmt.i_priority ) ) )
                         i_wanted = es->i_channel;
-- 
1.7.9.5




More information about the vlc-devel mailing list