]> git.sesse.net Git - vlc/commitdiff
livehttp: tell if playlist is vod
authorIlkka Ollakka <ileoo@videolan.org>
Sun, 17 Mar 2013 15:45:46 +0000 (17:45 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Sun, 17 Mar 2013 15:47:43 +0000 (17:47 +0200)
Mark EXT-X-PLAYLSIT-TYPE:EVENT if it's still under generating and at the
end, mark it as VOD in cases where we keep all the segments and those
are in playlist.

Closes: #6919
modules/access_output/livehttp.c

index 2878adb011305160749fdf08b3fdb01bf0b28616..cf5d6d7a627eed8295448953173acc55e5a1996a 100644 (file)
@@ -434,7 +434,11 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
             return -1;
         }
 
-        if ( fprintf( fp, "#EXTM3U\n#EXT-X-TARGETDURATION:%zu\n#EXT-X-VERSION:3\n#EXT-X-ALLOW-CACHE:%s\n#EXT-X-MEDIA-SEQUENCE:%"PRIu32"\n", p_sys->i_seglen, p_sys->b_caching ? "YES" : "NO",i_firstseg ) < 0 )
+        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,
+                          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 )
         {
             free( psz_idxTmp );
             fclose( fp );