File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,12 @@ impl Graph {
105
105
}
106
106
}
107
107
108
+ /// Check if the graph is fully initialized and can start rendering
109
+ pub fn is_active ( & self ) -> bool {
110
+ // currently we only require the destination node to be present
111
+ !self . nodes . is_empty ( )
112
+ }
113
+
108
114
pub fn add_node (
109
115
& mut self ,
110
116
index : AudioNodeId ,
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ impl RenderThread {
242
242
self . handle_control_messages ( ) ;
243
243
244
244
// if the thread is still booting, or shutting down, fill with silence
245
- if self . graph . is_none ( ) {
245
+ if ! self . graph . as_ref ( ) . is_some_and ( Graph :: is_active ) {
246
246
output_buffer. fill ( S :: from_sample_ ( 0. ) ) ;
247
247
return ;
248
248
}
You can’t perform that action at this time.
0 commit comments