[vlc-commits] demux: ts: correctly swap es id on restart

Francois Cartegnie git at videolan.org
Tue Mar 3 17:21:22 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar  3 17:18:09 2015 +0100| [b2f2c6f8c479a44cad6128c5cb3c3f9eeb94e1ee] | committer: Francois Cartegnie

demux: ts: correctly swap es id on restart

and missing extra es

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

 modules/demux/ts.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index d3243bb..eb40eac 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -5387,9 +5387,27 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
                     pespid->u.p_pes = p_pes;
                     p_pes = e;
 
+                    /* p_pes still tmp, but now contains old config */
+                    pespid->u.p_pes->es.id = p_pes->es.id;
                     if( pespid->u.p_pes->es.id )
+                    {
+                        p_pes->es.id = NULL;
                         es_out_Control( p_demux->out, ES_OUT_SET_ES_FMT,
-                                        pespid->u.p_pes->es.id, p_pes->es.fmt );
+                                        pespid->u.p_pes->es.id, pespid->u.p_pes->es.fmt );
+                    }
+
+                    for( int i=0; i<pespid->u.p_pes->extra_es.i_size &&
+                                  i<p_pes->extra_es.i_size; i++ )
+                    {
+                        pespid->u.p_pes->extra_es.p_elems[i]->id = p_pes->extra_es.p_elems[i]->id;
+                        if( pespid->u.p_pes->extra_es.p_elems[i]->id )
+                        {
+                            es_out_Control( p_demux->out, ES_OUT_SET_ES_FMT,
+                                            pespid->u.p_pes->extra_es.p_elems[i]->id,
+                                            pespid->u.p_pes->extra_es.p_elems[i]->fmt );
+                            p_pes->extra_es.p_elems[i]->id = NULL;
+                        }
+                    }
                 }
 
                 ts_pes_Del( p_demux, p_pes ); // delete temp



More information about the vlc-commits mailing list