Fix race in rendering final manifest
This commit is contained in:
parent
798fff1772
commit
e76ec06420
1 changed files with 15 additions and 13 deletions
28
src/imp.rs
28
src/imp.rs
|
@ -612,19 +612,21 @@ impl ElementImpl for FlexHlsSink {
|
|||
match transition {
|
||||
gst::StateChange::PausedToReady => {
|
||||
// Turning down
|
||||
let mut state = self.state.lock().unwrap();
|
||||
let write_final = match &mut *state {
|
||||
State::Stopped => false,
|
||||
State::Started {
|
||||
playlist,
|
||||
playlist_render_state,
|
||||
..
|
||||
} => {
|
||||
if *playlist_render_state == PlaylistRenderState::Started {
|
||||
playlist.end_list = true;
|
||||
true
|
||||
} else {
|
||||
false
|
||||
let write_final = {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
match &mut *state {
|
||||
State::Stopped => false,
|
||||
State::Started {
|
||||
playlist,
|
||||
playlist_render_state,
|
||||
..
|
||||
} => {
|
||||
if *playlist_render_state == PlaylistRenderState::Started {
|
||||
playlist.end_list = true;
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue