[vlc-commits] livehttp: add DISCONTINUITY on playlist if we have restarted stream

Ilkka Ollakka git at videolan.org
Fri Dec 5 10:50:56 CET 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Dec  4 16:50:38 2014 +0200| [85917d0522c1bc3b3ce292faf66f71e8ee8d5a80] | committer: Ilkka Ollakka

livehttp: add DISCONTINUITY on playlist if we have restarted stream

If provided initial-segment-number option, signal discontinuity so
player knows to reset timestamps etc for new segments.

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

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

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 0563f8d..19fb9aa 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -591,10 +591,11 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
         }
 
         if ( fprintf( fp, "#EXTM3U\n#EXT-X-TARGETDURATION:%zu\n#EXT-X-VERSION:3\n#EXT-X-ALLOW-CACHE:%s"
-                          "%s\n#EXT-X-MEDIA-SEQUENCE:%"PRIu32"\n", p_sys->i_seglen,
+                          "%s\n#EXT-X-MEDIA-SEQUENCE:%"PRIu32"\n%s", p_sys->i_seglen,
                           p_sys->b_caching ? "YES" : "NO",
                           p_sys->i_numsegs > 0 ? "" : b_isend ? "\n#EXT-X-PLAYLIST-TYPE:VOD" : "\n#EXT-X-PLAYLIST-TYPE:EVENT",
-                          i_firstseg ) < 0 )
+                          i_firstseg, ((p_sys->i_initial_segment > 1) && (p_sys->i_initial_segment == i_firstseg)) ? "#EXT-X-DISCONTINUITY\n" : ""
+                          ) < 0 )
         {
             free( psz_idxTmp );
             fclose( fp );



More information about the vlc-commits mailing list