[vlc-commits] ts demux: don't lose PID specific data on PMT callback

Rafaël Carré git at videolan.org
Sun Apr 28 09:04:46 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Apr 28 09:01:00 2013 +0200| [4495c7ee05d05eb6817bf7a2147eed598c6df404] | committer: Rafaël Carré

ts demux: don't lose PID specific data on PMT callback

Close #8480

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

 modules/demux/ts.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 71ced2b..25c72e8 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -3929,12 +3929,15 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt )
                     !strcmp( pid->es->fmt.psz_language,
                              old_pid->es->fmt.psz_language ) ) ) )
             {
-                pid->es->id = old_pid->es->id;
-                old_pid->es->id = NULL;
+                pid->i_cc = old_pid->i_cc;
+                ts_es_t *e = pid->es;
+                pid->es = old_pid->es;
+                old_pid->es = e;
                 for( int i = 0; i < pid->i_extra_es; i++ )
                 {
-                    pid->extra_es[i]->id = old_pid->extra_es[i]->id;
-                    old_pid->extra_es[i]->id = NULL;
+                    e = pid->extra_es[i];
+                    pid->extra_es[i] = old_pid->extra_es[i];
+                    old_pid->extra_es[i] = e;
                 }
             }
             else



More information about the vlc-commits mailing list