[vlc-commits] mux: mp4: flush blocks on stream deletion

Francois Cartegnie git at videolan.org
Mon Jan 8 12:10:57 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan  5 13:11:34 2018 +0100| [f516d21beb20cf7c471d36b362ea7435646f20ff] | committer: Francois Cartegnie

mux: mp4: flush blocks on stream deletion

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

 modules/mux/mp4/mp4.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/mux/mp4/mp4.c b/modules/mux/mp4/mp4.c
index 6dc41da696..8a71748a10 100644
--- a/modules/mux/mp4/mp4.c
+++ b/modules/mux/mp4/mp4.c
@@ -179,6 +179,7 @@ static bo_t *BuildMoov(sout_mux_t *p_mux);
 static block_t *ConvertSUBT(block_t *);
 static bool CreateCurrentEdit(mp4_stream_t *, mtime_t, bool);
 static void DebugEdits(sout_mux_t *, const mp4_stream_t *);
+static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_stream);
 
 /*****************************************************************************
  * Open:
@@ -482,10 +483,13 @@ static void DelStream(sout_mux_t *p_mux, sout_input_t *p_input)
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     mp4_stream_t *p_stream = (mp4_stream_t*)p_input->p_sys;
 
-    if(!p_sys->b_fragmented &&
-        CreateCurrentEdit(p_stream, p_sys->i_start_dts, false))
+    if(!p_sys->b_fragmented)
     {
-        DebugEdits(p_mux, p_stream);
+        while(block_FifoCount(p_input->p_fifo) > 0 &&
+              MuxStream(p_mux, p_input, p_stream) == VLC_SUCCESS) {};
+
+        if(CreateCurrentEdit(p_stream, p_sys->i_start_dts, false))
+            DebugEdits(p_mux, p_stream);
     }
 
     msg_Dbg(p_mux, "removing input");



More information about the vlc-commits mailing list