[vlc-commits] livehttp: allow segments to be 10% shorten than asked, seems to be usual limit of allowed variance

Ilkka Ollakka git at videolan.org
Thu Sep 13 10:50:47 CEST 2012


vlc/vlc-2.0 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Tue Aug 14 16:00:41 2012 +0300| [82c1c6abb3e04af9eafae9c0b5a2c6f757c7f929] | committer: Jean-Baptiste Kempf

livehttp: allow segments to be 10% shorten than asked, seems to be usual limit of allowed variance
(cherry picked from commit 58dfd2dc56fbc91398076728d6bea3c311b1ba4b)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access_output/livehttp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index d335a64..63c56b1 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -160,7 +160,8 @@ static int Open( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     p_sys->i_seglen = var_GetInteger( p_access, SOUT_CFG_PREFIX "seglen" );
-    p_sys->i_seglenm = CLOCK_FREQ * p_sys->i_seglen;
+    /* Try to get within +-10% of asked segment length, so lower limit is 90% of segment length*/
+    p_sys->i_seglenm = CLOCK_FREQ * p_sys->i_seglen * 0.9;
 
     p_sys->i_numsegs = var_GetInteger( p_access, SOUT_CFG_PREFIX "numsegs" );
     p_sys->b_splitanywhere = var_GetBool( p_access, SOUT_CFG_PREFIX "splitanywhere" );



More information about the vlc-commits mailing list