[vlc-commits] demux: ts: use preparsing flag

Francois Cartegnie git at videolan.org
Tue Oct 30 18:12:50 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct 24 17:23:34 2018 +0200| [9bf56f347b70dd5574af54138e88d4112c6eb076] | committer: Francois Cartegnie

demux: ts: use preparsing flag

(cherry picked from commit 09ef812c050ee4ce6a2fcaffa9b9fd335a6757ac)

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

 modules/demux/mpeg/ts.c | 8 +++-----
 modules/demux/mpeg/ts.h | 2 --
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 549ea66c47..1fdd2367fd 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -519,17 +519,15 @@ static int Open( vlc_object_t *p_this )
     vlc_stream_Control( p_sys->stream, STREAM_CAN_FASTSEEK,
                         &p_sys->b_canfastseek );
 
+    p_sys->es_creation = ( p_sys->b_access_control ? CREATE_ES : DELAY_ES );
+
     /* Preparse time */
-    if( p_sys->b_canseek )
+    if( p_demux->b_preparsing && p_sys->b_canseek )
     {
-        p_sys->es_creation = NO_ES;
         while( !p_sys->i_pmt_es && !p_sys->b_end_preparse )
             if( Demux( p_demux ) != VLC_DEMUXER_SUCCESS )
                 break;
-        p_sys->es_creation = DELAY_ES;
     }
-    else
-        p_sys->es_creation = ( p_sys->b_access_control ? CREATE_ES : DELAY_ES );
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/mpeg/ts.h b/modules/demux/mpeg/ts.h
index c45b870302..239324cec0 100644
--- a/modules/demux/mpeg/ts.h
+++ b/modules/demux/mpeg/ts.h
@@ -81,11 +81,9 @@ struct demux_sys_t
 
     enum
     {
-        NO_ES, /* for preparse */
         DELAY_ES,
         CREATE_ES
     } es_creation;
-    #define PREPARSING p_sys->es_creation == NO_ES
 
     /* */
     bool        b_es_id_pid;



More information about the vlc-commits mailing list