Skip to content

Commit 5dac157

Browse files
committed
Align ConstantSourceRenderer::onmessage() with other implementations
1 parent 22775b8 commit 5dac157

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/node/constant_source.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,18 @@ impl AudioProcessor for ConstantSourceRenderer {
203203
}
204204

205205
fn onmessage(&mut self, msg: Box<dyn std::any::Any + Send + 'static>) {
206-
if let Ok(schedule) = msg.downcast::<Schedule>() {
207-
match *schedule {
208-
Schedule::Start(v) => self.start_time = v,
209-
Schedule::Stop(v) => self.stop_time = v,
206+
let msg = match msg.downcast::<Schedule>() {
207+
Ok(schedule) => {
208+
match *schedule {
209+
Schedule::Start(v) => self.start_time = v,
210+
Schedule::Stop(v) => self.stop_time = v,
211+
}
212+
return;
210213
}
211-
return;
212-
}
214+
Err(msg) => msg,
215+
};
213216

214-
log::warn!("ConstantSourceRenderer: Ignoring incoming message");
217+
log::warn!("ConstantSourceRenderer: Dropping incoming message {msg:?}");
215218
}
216219
}
217220

0 commit comments

Comments
 (0)