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

Denis Charmet git at videolan.org
Mon Sep 30 21:16:14 CEST 2013


vlc | branch: master | Denis Charmet <typx at dinauz.org> | Mon Sep 30 14:54:37 2013 +0200| [bb5154013b2f691a358c3837444e03bdce5f6f24] | committer: Denis Charmet

Correctly check the index in the pref. list when selecting the ES.

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

Fix #9531

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bb5154013b2f691a358c3837444e03bdce5f6f24
---

 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;



More information about the vlc-commits mailing list