[vlc-commits] access: dvdnav: always check es creation

Francois Cartegnie git at videolan.org
Fri Mar 31 14:52:07 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar 31 14:30:09 2017 +0200| [c36171857c1e3f7c6422cfe6c3b1ca4bad4f5bc8] | committer: Francois Cartegnie

access: dvdnav: always check es creation

can always fail, including missing decoder

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

 modules/access/dvdnav.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index c061169..c22b080 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -1305,18 +1305,21 @@ static void ESSubtitleUpdate( demux_t *p_demux )
         ESNew( p_demux, 0xbd20 + i_spu );
 
         /* be sure to unselect it (reset) */
-        es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->es,
-                        (bool)false );
+        if( tk->es )
+        {
+            es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->es,
+                            (bool)false );
 
-        /* now select it */
-        es_out_Control( p_demux->out, ES_OUT_SET_ES, tk->es );
+            /* now select it */
+            es_out_Control( p_demux->out, ES_OUT_SET_ES, tk->es );
+        }
     }
     else
     {
         for( i_spu = 0; i_spu <= 0x1F; i_spu++ )
         {
             ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(0xbd20 + i_spu)];
-            if( tk->b_configured )
+            if( tk->es )
             {
                 es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->es,
                                 (bool)false );
@@ -1514,7 +1517,7 @@ static void ESNew( demux_t *p_demux, int i_id )
     }
 
     tk->es = es_out_Add( p_demux->out, &tk->fmt );
-    if( b_select )
+    if( b_select && tk->es )
     {
         es_out_Control( p_demux->out, ES_OUT_SET_ES, tk->es );
     }



More information about the vlc-commits mailing list