Skip to content

Commit

Permalink
src: stream: Fix default streams not starting up after a single reset
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Apr 21, 2023
1 parent 2f2d212 commit 7333db3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/stream/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ pub fn remove_all_streams() -> Result<()> {

#[instrument(level = "debug")]
pub fn start_default() -> Result<()> {
// First of all, gently remove all streams as we are going to replace the entire list below
remove_all_streams()?;

// Get streams from default settings, this needs to be done first because
// remove_all_streams will modify the settings as its using the stream manager
// to remove the streams, and the stream manager will save the state after
// each removal in the settings
let mut streams = settings::manager::streams();

// Gently remove all streams as we are going to replace the entire list below
remove_all_streams()?;

// Update all local video sources to make sure that they are available
let mut candidates = video_source::cameras_available();
update_devices(&mut streams, &mut candidates);
Expand Down

0 comments on commit 7333db3

Please sign in to comment.