[vlc-commits] es_out: fix track reselection (fix #18543)

Francois Cartegnie git at videolan.org
Mon Jul 17 20:13:31 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jul 17 19:07:34 2017 +0200| [13c895eee1db0360c9bf8fbffaf8575db49c85e9] | committer: Francois Cartegnie

es_out: fix track reselection (fix #18543)

When a new ES is added and selected,
and the p_main_es is deleted, the es selection event
isn't triggered because the es is already selected

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

 src/input/es_out.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index e0a1878f59..16e966b91c 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -2158,7 +2158,16 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
         for( i = 0; i < p_sys->i_es; i++ )
         {
             if( es->fmt.i_cat == p_sys->es[i]->fmt.i_cat )
-                EsOutSelect( out, p_sys->es[i], false );
+            {
+                if( EsIsSelected(p_sys->es[i]) )
+                {
+                    input_SendEventEsSelect( p_sys->p_input, es->fmt.i_cat, p_sys->es[i]->i_id );
+                    if( p_esprops->p_main_es == NULL )
+                        p_esprops->p_main_es = p_sys->es[i];
+                }
+                else
+                    EsOutSelect( out, p_sys->es[i], false );
+            }
         }
     }
 



More information about the vlc-commits mailing list