Skip to content

Commit 480f6d1

Browse files
committed
Fix confusing naming of suspend/resume/close control messages
1 parent e9330cd commit 480f6d1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/context/online.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ impl AudioContext {
390390
// First, pause rendering via a control message
391391
let (sender, receiver) = oneshot::channel();
392392
let notify = OneshotNotify::Async(sender);
393-
let suspend_msg = ControlMessage::Suspend { notify };
394-
self.base.send_control_msg(suspend_msg);
393+
self.base
394+
.send_control_msg(ControlMessage::Suspend { notify });
395395

396396
// Wait for the render thread to have processed the suspend message.
397397
// The AudioContextState will be updated by the render thread.
@@ -417,8 +417,8 @@ impl AudioContext {
417417
// Then, ask to resume rendering via a control message
418418
let (sender, receiver) = oneshot::channel();
419419
let notify = OneshotNotify::Async(sender);
420-
let suspend_msg = ControlMessage::Resume { notify };
421-
self.base.send_control_msg(suspend_msg);
420+
self.base
421+
.send_control_msg(ControlMessage::Resume { notify });
422422

423423
// Wait for the render thread to have processed the resume message
424424
// The AudioContextState will be updated by the render thread.
@@ -437,8 +437,7 @@ impl AudioContext {
437437
// First, stop rendering via a control message
438438
let (sender, receiver) = oneshot::channel();
439439
let notify = OneshotNotify::Async(sender);
440-
let suspend_msg = ControlMessage::Close { notify };
441-
self.base.send_control_msg(suspend_msg);
440+
self.base.send_control_msg(ControlMessage::Close { notify });
442441

443442
// Wait for the render thread to have processed the suspend message.
444443
// The AudioContextState will be updated by the render thread.
@@ -471,8 +470,8 @@ impl AudioContext {
471470
// First, pause rendering via a control message
472471
let (sender, receiver) = crossbeam_channel::bounded(0);
473472
let notify = OneshotNotify::Sync(sender);
474-
let suspend_msg = ControlMessage::Suspend { notify };
475-
self.base.send_control_msg(suspend_msg);
473+
self.base
474+
.send_control_msg(ControlMessage::Suspend { notify });
476475

477476
// Wait for the render thread to have processed the suspend message.
478477
// The AudioContextState will be updated by the render thread.
@@ -501,8 +500,8 @@ impl AudioContext {
501500
// Then, ask to resume rendering via a control message
502501
let (sender, receiver) = crossbeam_channel::bounded(0);
503502
let notify = OneshotNotify::Sync(sender);
504-
let suspend_msg = ControlMessage::Resume { notify };
505-
self.base.send_control_msg(suspend_msg);
503+
self.base
504+
.send_control_msg(ControlMessage::Resume { notify });
506505

507506
// Wait for the render thread to have processed the resume message
508507
// The AudioContextState will be updated by the render thread.
@@ -524,8 +523,7 @@ impl AudioContext {
524523
// First, stop rendering via a control message
525524
let (sender, receiver) = crossbeam_channel::bounded(0);
526525
let notify = OneshotNotify::Sync(sender);
527-
let suspend_msg = ControlMessage::Close { notify };
528-
self.base.send_control_msg(suspend_msg);
526+
self.base.send_control_msg(ControlMessage::Close { notify });
529527

530528
// Wait for the render thread to have processed the suspend message.
531529
// The AudioContextState will be updated by the render thread.

0 commit comments

Comments
 (0)