better write out, then drop

This commit is contained in:
jb-alvarado 2022-04-18 14:36:54 +02:00
parent 790e22a50d
commit f3eb5da16f

View File

@ -129,7 +129,6 @@ pub fn player(
}
live_on = true;
*playlist_init.lock().unwrap() = true;
}
@ -148,8 +147,15 @@ pub fn player(
error!("Encoder error: {e}")
}
let trashcan: Vec<_> = ingest_receiver.try_iter().collect();
drop(trashcan);
let rest_from_receiver: Vec<_> = ingest_receiver.try_iter().collect();
for rest in rest_from_receiver {
if let Err(e) = enc_writer.write(&rest.1[..rest.0]) {
error!("Encoder write error: {:?}", e);
break 'source_iter;
};
}
live_on = false;
}