Fix race in rendering final manifest

This commit is contained in:
Rafael Caricio 2021-05-14 18:48:12 +02:00
parent 798fff1772
commit e76ec06420
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947

View file

@ -612,19 +612,21 @@ impl ElementImpl for FlexHlsSink {
match transition { match transition {
gst::StateChange::PausedToReady => { gst::StateChange::PausedToReady => {
// Turning down // Turning down
let mut state = self.state.lock().unwrap(); let write_final = {
let write_final = match &mut *state { let mut state = self.state.lock().unwrap();
State::Stopped => false, match &mut *state {
State::Started { State::Stopped => false,
playlist, State::Started {
playlist_render_state, playlist,
.. playlist_render_state,
} => { ..
if *playlist_render_state == PlaylistRenderState::Started { } => {
playlist.end_list = true; if *playlist_render_state == PlaylistRenderState::Started {
true playlist.end_list = true;
} else { true
false } else {
false
}
} }
} }
}; };