mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 02:26:35 +00:00
hlssink3: Close the playlist giostreamsink on stop if possible
This is a property that will be available from GStreamer 1.24, and will ensure that we are able to flush the playlist during the READY->NULL transition instead of when the element is freed. Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/423 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1360>
This commit is contained in:
parent
a49a5dcb11
commit
d27a04e067
1 changed files with 13 additions and 0 deletions
|
@ -627,6 +627,19 @@ impl Default for HlsSink3Settings {
|
|||
.property("sink", &giostreamsink)
|
||||
.build()
|
||||
.expect("Could not make element splitmuxsink");
|
||||
|
||||
// giostreamsink doesn't let go of its stream until the element is finalized, which might
|
||||
// be too late for the calling application. Let's try to force it to close while tearing
|
||||
// down the pipeline.
|
||||
if giostreamsink.has_property("close-on-stop", Some(bool::static_type())) {
|
||||
giostreamsink.set_property("close-on-stop", true);
|
||||
} else {
|
||||
gst::warning!(
|
||||
CAT,
|
||||
"hlssink3 may sometimes fail to write out the final playlist update. This can be fixed by using giostreamsink from GStreamer 1.24 or later."
|
||||
)
|
||||
}
|
||||
|
||||
Self {
|
||||
location: String::from(DEFAULT_TS_LOCATION),
|
||||
target_duration: DEFAULT_TARGET_DURATION,
|
||||
|
|
Loading…
Reference in a new issue