[vlc-commits] livehttp: check opendts to be lowest dts available

Ilkka Ollakka git at videolan.org
Tue Jun 18 20:18:38 CEST 2013


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Jun  5 16:24:19 2013 +0300| [f3b30afc36fb9bac57a485f33c9c53b711e9e9ae] | committer: Ilkka Ollakka

livehttp: check opendts to be lowest dts available

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

 modules/access_output/livehttp.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 0c85457..e92a40c 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -236,6 +236,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->segments_t = vlc_array_new();
 
     p_sys->stuffing_size = 0;
+    p_sys->i_opendts = VLC_TS_INVALID;
 
     p_sys->psz_indexPath = NULL;
     psz_idx = var_GetNonEmptyString( p_access, SOUT_CFG_PREFIX "index" );
@@ -897,6 +898,10 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
             if ( p_sys->i_handle < 0 )
             {
                 p_sys->i_opendts = output ? output->i_dts : p_buffer->i_dts;
+                //For first segment we can get negative duration otherwise...?
+                if( ( p_sys->i_opendts != VLC_TS_INVALID ) &&
+                    ( p_buffer->i_dts < p_sys->i_opendts ) )
+                    p_sys->i_opendts = p_buffer->i_dts;
                 if ( openNextFile( p_access, p_sys ) < 0 )
                    return -1;
             }



More information about the vlc-commits mailing list