[vlc-commits] Revert "demux: ts: fix inconsistency on un/seekable UNKOWN_ES"

Francois Cartegnie git at videolan.org
Mon Dec 12 17:25:22 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 12 17:08:22 2016 +0100| [bf0252169517bd58badd87012d77999464410a2a] | committer: Francois Cartegnie

Revert "demux: ts: fix inconsistency on un/seekable UNKOWN_ES"

Breaks PMT shared pid

This reverts commit c78a7a1c856fa222d8c470839eb69d3ac78f295c.

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

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

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index d6cfc10..2334b12 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -2695,15 +2695,13 @@ void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid, bool b_create_delayed )
 
     if( pid && p_sys->es_creation == CREATE_ES )
     {
-        ts_pes_es_t *p_es = pid->u.p_pes->p_es;
-        DoCreateES( p_demux, p_es, NULL );
+        DoCreateES( p_demux, pid->u.p_pes->p_es, NULL );
 
         /* Update the default program == first created ES group */
-        if( p_sys->b_default_selection && p_sys->programs.i_size > 0 &&
-            (p_es->fmt.i_cat == VIDEO_ES || p_es->fmt.i_cat == AUDIO_ES) )
+        if( p_sys->b_default_selection && p_sys->programs.i_size > 0)
         {
             p_sys->b_default_selection = false;
-            const int i_first_program = p_es->p_program->i_number;
+            const int i_first_program = pid->u.p_pes->p_es->p_program->i_number;
             if( p_sys->programs.p_elems[0] != i_first_program )
                 p_sys->programs.p_elems[0] = i_first_program;
             msg_Dbg( p_demux, "Default program is %d", i_first_program );
diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 260cf53..a8535a1 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -1702,6 +1702,8 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
                      (p_dr->p_data[0] << 8) | p_dr->p_data[1] );
         }
 
+        const bool b_create_es = (p_pes->p_es->fmt.i_cat != UNKNOWN_ES);
+
         /* Now check and merge */
         if( b_pid_inuse ) /* We need to compare to the existing pes/es */
         {
@@ -1762,7 +1764,8 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
             }
         }
         /* Nothing to do, pes is now just set */
-        AddAndCreateES( p_demux, pespid, false );
+        if( b_create_es )
+            AddAndCreateES( p_demux, pespid, false );
     }
 
     /* Set CAM descrambling */



More information about the vlc-commits mailing list