[vlc-commits] demux: mp4: don't create twice track on restart

Francois Cartegnie git at videolan.org
Wed Oct 21 17:32:09 CEST 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jun  8 12:44:05 2015 +0200| [3f83ba420115791e3db107e5f20bf44c60f88665] | committer: Jean-Baptiste Kempf

demux: mp4: don't create twice track on restart

(cherry picked from commit f6d41e3d5bb57be3fde6648f98c95a410a925c26)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mp4/mp4.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 58353eb..9ceb325 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3932,6 +3932,7 @@ static int ReInitDecoder( demux_t *p_demux, mp4_track_t *p_track )
 
     i_sample = p_track->i_sample;
     es_out_Del( p_demux->out, p_track->p_es );
+    p_track->p_es = NULL;
     es_format_Clean( &p_track->fmt );
 
     if( b_smooth )
@@ -3945,8 +3946,8 @@ static int ReInitDecoder( demux_t *p_demux, mp4_track_t *p_track )
     p_track->b_selected = true;
     p_track->b_ok = true;
     p_track->b_enable = true;
-
-    p_track->p_es = es_out_Add( p_demux->out, &p_track->fmt );
+    if(!p_track->p_es)
+        p_track->p_es = es_out_Add( p_demux->out, &p_track->fmt );
     p_track->b_codec_need_restart = false;
 
     return VLC_SUCCESS;



More information about the vlc-commits mailing list