mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 03:21:00 +00:00
uriplaylistbin: Properly clean up the pipeline on panics/assertions too
Reduces log noise. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1769>
This commit is contained in:
parent
a709eb96d9
commit
7a959b9e9d
1 changed files with 17 additions and 1 deletions
|
@ -78,6 +78,22 @@ struct IterationsChange {
|
|||
iterations: u32,
|
||||
}
|
||||
|
||||
struct Pipeline(gst::Pipeline);
|
||||
|
||||
impl std::ops::Deref for Pipeline {
|
||||
type Target = gst::Pipeline;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Pipeline {
|
||||
fn drop(&mut self) {
|
||||
let _ = self.0.set_state(gst::State::Null);
|
||||
}
|
||||
}
|
||||
|
||||
fn test(
|
||||
medias: Vec<TestMedia>,
|
||||
n_streams: u32,
|
||||
|
@ -93,7 +109,7 @@ fn test(
|
|||
|
||||
let uris: Vec<String> = medias.iter().map(|t| t.uri.clone()).collect();
|
||||
|
||||
let pipeline = gst::Pipeline::default();
|
||||
let pipeline = Pipeline(gst::Pipeline::default());
|
||||
let playlist = gst::ElementFactory::make("uriplaylistbin")
|
||||
.property("uris", &uris)
|
||||
.property("iterations", iterations)
|
||||
|
|
Loading…
Reference in a new issue