[vlc-commits] demux: ts: set generated flag before callback

Francois Cartegnie git at videolan.org
Tue Oct 13 20:14:52 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct 13 17:06:55 2020 +0200| [16d8f864c52036fdd7e6de5c3f1035ded0def1dd] | committer: Francois Cartegnie

demux: ts: set generated flag before callback

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

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

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 1e6e2b3b35..9e976bd046 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -623,9 +623,9 @@ static int Demux( demux_t *p_demux )
     /* If we had no PAT within MIN_PAT_INTERVAL, create PAT/PMT from probed streams */
     if( p_sys->i_pmt_es == 0 && !SEEN(GetPID(p_sys, 0)) && p_sys->patfix.status == PAT_MISSING )
     {
+        GetPID(p_sys, 0)->u.p_pat->b_generated = true;
         MissingPATPMTFixup( p_demux );
         p_sys->patfix.status = PAT_FIXTRIED;
-        GetPID(p_sys, 0)->u.p_pat->b_generated = true;
     }
 
     /* We read at most 100 TS packet or until a frame is completed */
diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 10cd2eb758..9aa73b9935 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -112,7 +112,10 @@ static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat )
             return;
         }
     }
-    else msg_Warn( p_demux, "Replacing generated PAT with one received from stream" );
+    else if( p_pat->i_version != -1 )
+    {
+        msg_Warn( p_demux, "Replacing generated PAT with one received from stream" );
+    }
 
     /* check content */
     if( !p_dvbpsipat->b_current_next || p_sys->b_user_pmt ||



More information about the vlc-commits mailing list