[vlc-commits] sout: be more resilient with broken streams

Francois Cartegnie git at videolan.org
Wed Jul 11 14:30:50 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jul 10 16:22:33 2018 +0200| [a4451cd32d8e4ffed15f2d59740b1a0ec1ee3f14] | committer: Francois Cartegnie

sout: be more resilient with broken streams

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

 src/stream_output/stream_output.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 904fcc51a6..18aabd7227 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -543,7 +543,10 @@ int sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
                       current_date - i_dts );
     }
 
-    if( p_mux->b_waiting_stream )
+    if( i_dts == VLC_TICK_INVALID )
+        i_dts = p_buffer->i_pts;
+
+    if( p_mux->b_waiting_stream && i_dts != VLC_TICK_INVALID )
     {
         const vlc_tick_t i_caching = VLC_TICK_FROM_MS(var_GetInteger( p_mux->p_sout, "sout-mux-caching" ));
 
@@ -551,8 +554,7 @@ int sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
             p_mux->i_add_stream_start = i_dts;
 
         /* Wait until we have enough data before muxing */
-        if( p_mux->i_add_stream_start == VLC_TICK_INVALID ||
-            i_dts < p_mux->i_add_stream_start + i_caching )
+        if( llabs( i_dts - p_mux->i_add_stream_start ) < i_caching )
             return VLC_SUCCESS;
         p_mux->b_waiting_stream = false;
     }



More information about the vlc-commits mailing list