File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,7 @@ impl Graph {
354
354
}
355
355
356
356
/// Render a single audio quantum by traversing the node list
357
- pub fn render ( & mut self , scope : & RenderScope ) -> AudioRenderQuantum {
357
+ pub fn render ( & mut self , scope : & RenderScope ) -> & AudioRenderQuantum {
358
358
// if the audio graph was changed, determine the new ordering
359
359
if self . ordered . is_empty ( ) {
360
360
self . order_nodes ( ) ;
@@ -460,12 +460,12 @@ impl Graph {
460
460
}
461
461
462
462
// Return the output buffer of destination node
463
- self . nodes
463
+ & self
464
+ . nodes
464
465
. get_mut ( & AudioNodeId ( 0 ) )
465
466
. unwrap ( )
466
467
. get_mut ( )
467
468
. outputs [ 0 ]
468
- . clone ( )
469
469
}
470
470
}
471
471
Original file line number Diff line number Diff line change @@ -257,8 +257,8 @@ impl RenderThread {
257
257
node_id : Cell :: new ( AudioNodeId ( 0 ) ) , // placeholder value
258
258
} ;
259
259
260
- // render audio graph
261
- let mut rendered = self . graph . as_mut ( ) . unwrap ( ) . render ( & scope) ;
260
+ // render audio graph, clone it in case we need to mutate/store the value later
261
+ let mut rendered = self . graph . as_mut ( ) . unwrap ( ) . render ( & scope) . clone ( ) ;
262
262
263
263
// online AudioContext allows channel count to be less than no of hardware channels
264
264
if rendered. number_of_channels ( ) != self . number_of_channels {
You can’t perform that action at this time.
0 commit comments