mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
hlssink2: Respect requested max-files property for decision on removing old fragments from disk
hlssink2 defined "max-files" property to decide the maximum number of fragments which should be stored in disk. But we've not used the property. Instead, the size has been maintained by "playlist-length". Since "max-files" and "playlist-length" have different meaning, the decision should be done by "max-files" property. For example, an user might want expose only 3 fragments via playlist but might want to keep more files than 3 in disk.
This commit is contained in:
parent
84718775a2
commit
2c394df69d
1 changed files with 6 additions and 5 deletions
|
@ -295,11 +295,12 @@ gst_hls_sink2_handle_message (GstBin * bin, GstMessage * message)
|
||||||
g_queue_push_tail (&sink->old_locations,
|
g_queue_push_tail (&sink->old_locations,
|
||||||
g_strdup (sink->current_location));
|
g_strdup (sink->current_location));
|
||||||
|
|
||||||
while (g_queue_get_length (&sink->old_locations) >
|
if (sink->max_files > 0) {
|
||||||
g_queue_get_length (sink->playlist->entries)) {
|
while (g_queue_get_length (&sink->old_locations) > sink->max_files) {
|
||||||
gchar *old_location = g_queue_pop_head (&sink->old_locations);
|
gchar *old_location = g_queue_pop_head (&sink->old_locations);
|
||||||
g_remove (old_location);
|
g_remove (old_location);
|
||||||
g_free (old_location);
|
g_free (old_location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue