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

Francois Cartegnie git at videolan.org
Mon Jun 8 12:55:13 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jun  8 12:44:05 2015 +0200| [f6d41e3d5bb57be3fde6648f98c95a410a925c26] | committer: Francois Cartegnie

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

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

 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 0d52b40..620be39 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3615,6 +3615,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 )
@@ -3628,8 +3629,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