[vlc-commits] es_out: refactor and add comment

Thomas Guillem git at videolan.org
Tue Feb 18 14:36:33 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 13 16:28:26 2020 +0100| [df560726c06b02f02ee32952a01ff077b2ecefbe] | committer: Thomas Guillem

es_out: refactor and add comment

No functional changes.

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

 src/input/es_out.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index 32c4089ef8..f56e009315 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1265,11 +1265,16 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
 
         foreach_es_then_es_slaves(es)
         {
-            if (es->p_pgrm == old && EsIsSelected(es)
-             && p_sys->i_mode != ES_OUT_MODE_ALL)
+            if (es->p_pgrm != old)
+                continue;
+
+            if (EsIsSelected(es) && p_sys->i_mode != ES_OUT_MODE_ALL)
                 EsOutUnselectEs(out, es, true);
-            if (es->p_pgrm == old)
-                EsOutSendEsEvent( out, es, VLC_INPUT_ES_DELETED );
+
+            /* ES tracks are deleted (and unselected) when their programs are
+             * unselected (they will be added back when their programs are
+             * selected back). */
+            EsOutSendEsEvent( out, es, VLC_INPUT_ES_DELETED );
         }
 
         p_sys->audio.p_main_es = NULL;



More information about the vlc-commits mailing list