hlssink: allow creation of 'infinite' playlist

Allow the playlist-length to accept '0' as a value, indicating
that no segment should be removed from the playlist. This allows
generating playlists to be used as VOD when complete.
This commit is contained in:
Thiago Santos 2015-02-17 10:04:30 -03:00
parent 6ec5904d46
commit 00bdac51a3
2 changed files with 4 additions and 3 deletions

View file

@ -161,8 +161,9 @@ gst_hls_sink_class_init (GstHlsSinkClass * klass)
g_object_class_install_property (gobject_class, PROP_PLAYLIST_LENGTH, g_object_class_install_property (gobject_class, PROP_PLAYLIST_LENGTH,
g_param_spec_uint ("playlist-length", "Playlist length", g_param_spec_uint ("playlist-length", "Playlist length",
"Length of HLS playlist. To allow players to conform to section 6.3.3 " "Length of HLS playlist. To allow players to conform to section 6.3.3 "
"of the HLS specification, this should be at least 3.", "of the HLS specification, this should be at least 3. If set to 0, "
1, G_MAXUINT, DEFAULT_PLAYLIST_LENGTH, "the playlist will be infinite.",
0, G_MAXUINT, DEFAULT_PLAYLIST_LENGTH,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
} }

View file

@ -129,7 +129,7 @@ gst_m3u8_playlist_add_entry (GstM3U8Playlist * playlist,
entry = gst_m3u8_entry_new (url, title, duration, discontinuous); entry = gst_m3u8_entry_new (url, title, duration, discontinuous);
if (playlist->window_size != -1) { if (playlist->window_size > 0) {
/* Delete old entries from the playlist */ /* Delete old entries from the playlist */
while (playlist->entries->length >= playlist->window_size) { while (playlist->entries->length >= playlist->window_size) {
GstM3U8Entry *old_entry; GstM3U8Entry *old_entry;