diff --git a/Cargo.lock b/Cargo.lock index 5f75c045..df44f435 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -866,7 +866,7 @@ dependencies = [ [[package]] name = "bevy" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_internal", ] @@ -874,7 +874,7 @@ dependencies = [ [[package]] name = "bevy_a11y" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "accesskit", "bevy_app", @@ -885,7 +885,7 @@ dependencies = [ [[package]] name = "bevy_animation" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -914,7 +914,7 @@ dependencies = [ [[package]] name = "bevy_app" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_derive", "bevy_ecs", @@ -931,7 +931,7 @@ dependencies = [ [[package]] name = "bevy_asset" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "async-broadcast", "async-fs", @@ -963,7 +963,7 @@ dependencies = [ [[package]] name = "bevy_asset_macros" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "proc-macro2", @@ -996,7 +996,7 @@ dependencies = [ [[package]] name = "bevy_audio" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -1014,7 +1014,7 @@ dependencies = [ [[package]] name = "bevy_color" version = "0.14.2" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_math", "bevy_reflect", @@ -1051,7 +1051,7 @@ dependencies = [ [[package]] name = "bevy_core" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_ecs", @@ -1064,7 +1064,7 @@ dependencies = [ [[package]] name = "bevy_core_pipeline" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -1088,7 +1088,7 @@ dependencies = [ [[package]] name = "bevy_derive" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "quote", @@ -1098,7 +1098,7 @@ dependencies = [ [[package]] name = "bevy_diagnostic" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_core", @@ -1124,7 +1124,7 @@ dependencies = [ [[package]] name = "bevy_ecs" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "arrayvec", "bevy_ecs_macros", @@ -1144,7 +1144,7 @@ dependencies = [ [[package]] name = "bevy_ecs_macros" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "proc-macro2", @@ -1189,7 +1189,7 @@ dependencies = [ [[package]] name = "bevy_encase_derive" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "encase_derive_impl", @@ -1198,7 +1198,7 @@ dependencies = [ [[package]] name = "bevy_gilrs" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_ecs", @@ -1212,7 +1212,7 @@ dependencies = [ [[package]] name = "bevy_gizmos" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -1234,7 +1234,7 @@ dependencies = [ [[package]] name = "bevy_gizmos_macros" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "proc-macro2", @@ -1245,7 +1245,7 @@ dependencies = [ [[package]] name = "bevy_gltf" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "base64 0.22.1", "bevy_animation", @@ -1275,7 +1275,7 @@ dependencies = [ [[package]] name = "bevy_hierarchy" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_core", @@ -1288,7 +1288,7 @@ dependencies = [ [[package]] name = "bevy_input" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_ecs", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "bevy_internal" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_a11y", "bevy_animation", @@ -1355,7 +1355,7 @@ dependencies = [ [[package]] name = "bevy_log" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "android_log-sys", "bevy_app", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "bevy_macro_utils" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "proc-macro2", "quote", @@ -1394,7 +1394,7 @@ dependencies = [ [[package]] name = "bevy_math" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_reflect", "glam 0.27.0", @@ -1407,7 +1407,7 @@ dependencies = [ [[package]] name = "bevy_mikktspace" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "glam 0.27.0", ] @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "bevy_pbr" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -1441,12 +1441,12 @@ dependencies = [ [[package]] name = "bevy_ptr" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" [[package]] name = "bevy_reflect" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_ptr", "bevy_reflect_derive", @@ -1465,7 +1465,7 @@ dependencies = [ [[package]] name = "bevy_reflect_derive" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "proc-macro2", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "bevy_render" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "async-channel 2.3.1", "bevy_app", @@ -1525,7 +1525,7 @@ dependencies = [ [[package]] name = "bevy_render_macros" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "proc-macro2", @@ -1536,7 +1536,7 @@ dependencies = [ [[package]] name = "bevy_scene" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -1565,7 +1565,7 @@ dependencies = [ [[package]] name = "bevy_sprite" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "bevy_state" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_ecs", @@ -1603,7 +1603,7 @@ dependencies = [ [[package]] name = "bevy_state_macros" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_macro_utils 0.14.1", "proc-macro2", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "bevy_tasks" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "async-channel 2.3.1", "async-executor", @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "bevy_text" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_asset", @@ -1650,7 +1650,7 @@ dependencies = [ [[package]] name = "bevy_time" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_ecs", @@ -1663,7 +1663,7 @@ dependencies = [ [[package]] name = "bevy_transform" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_app", "bevy_ecs", @@ -1676,7 +1676,7 @@ dependencies = [ [[package]] name = "bevy_ui" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_a11y", "bevy_app", @@ -1705,7 +1705,7 @@ dependencies = [ [[package]] name = "bevy_utils" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "ahash", "bevy_utils_proc_macros", @@ -1719,7 +1719,7 @@ dependencies = [ [[package]] name = "bevy_utils_proc_macros" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "proc-macro2", "quote", @@ -1729,7 +1729,7 @@ dependencies = [ [[package]] name = "bevy_window" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "bevy_a11y", "bevy_app", @@ -1744,7 +1744,7 @@ dependencies = [ [[package]] name = "bevy_winit" version = "0.14.1" -source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#5cd52a4e31c9561926b98bb404db3e81db6bccc2" +source = "git+https://github.com/robtfm/bevy?branch=release-0.14-dcl-cosmic-noimage#4cc52109337b58b36eebd4c453890754916386dc" dependencies = [ "accesskit_winit", "approx", diff --git a/crates/av/src/audio_source.rs b/crates/av/src/audio_source.rs index 35987e15..3744e688 100644 --- a/crates/av/src/audio_source.rs +++ b/crates/av/src/audio_source.rs @@ -113,6 +113,7 @@ fn update_audio( continue; }; + error!("clip {:?}", audio_source.0); new_state = Some(AudioSourceState { handle, clip_url: audio_source.0.audio_clip_url.clone(), @@ -160,8 +161,15 @@ fn update_audio( ); playing_instance.set_playback_rate(playback_rate, AudioTween::default()); if let Some(time) = audio_source.0.current_time { - if let Some(err) = playing_instance.seek_to(time as f64) { - warn!("seek error: {}", err); + if time < 1e6 { + if let Some(err) = playing_instance.seek_to(time as f64) { + warn!("seek error: {}", err); + } + } else { + warn!( + "ignoring ridiculous time offset {} for audio clip `{}`", + time, audio_source.0.audio_clip_url + ); } } } @@ -176,7 +184,14 @@ fn update_audio( new_instance.with_playback_rate(audio_source.0.pitch.unwrap_or(1.0) as f64); if let Some(time) = audio_source.0.current_time { - new_instance.start_from(time as f64); + if time < 1e6 { + new_instance.start_from(time as f64); + } else { + warn!( + "ignoring ridiculous start time {} for audio clip `{}`", + time, audio_source.0.audio_clip_url + ); + } } commands.entity(ent).try_insert(AudioEmitter { diff --git a/crates/comms/src/livekit_room.rs b/crates/comms/src/livekit_room.rs index 8a4872ac..88b4f4f2 100644 --- a/crates/comms/src/livekit_room.rs +++ b/crates/comms/src/livekit_room.rs @@ -3,11 +3,7 @@ use std::sync::Arc; use async_tungstenite::tungstenite::http::Uri; -use bevy::{ - prelude::*, - tasks::{IoTaskPool, Task}, - utils::HashMap, -}; +use bevy::{prelude::*, utils::HashMap}; use futures_lite::StreamExt; use livekit::{ id::TrackSid, @@ -62,7 +58,7 @@ pub struct LivekitTransport { } #[derive(Component)] -pub struct LivekitConnection(pub Task<()>); +pub struct LivekitConnection; pub fn start_livekit( mut commands: Commands, @@ -116,20 +112,17 @@ fn connect_livekit( let receiver = new_transport.receiver.take().unwrap(); let sender = player_state.get_sender(); - let task = IoTaskPool::get().spawn(livekit_handler( - transport_id, - remote_address, - receiver, - sender, - mic.subscribe(), - )); - commands - .entity(transport_id) - .try_insert(LivekitConnection(task)); + let subscription = mic.subscribe(); + + std::thread::spawn(move || { + livekit_handler(transport_id, remote_address, receiver, sender, subscription) + }); + + commands.entity(transport_id).try_insert(LivekitConnection); } } -async fn livekit_handler( +fn livekit_handler( transport_id: Entity, remote_address: String, receiver: Receiver, @@ -145,12 +138,10 @@ async fn livekit_handler( receiver.clone(), sender.clone(), mic.resubscribe(), - ) - .await - { + ) { warn!("livekit error: {e}"); } - if receiver.lock().await.is_closed() { + if receiver.blocking_lock().is_closed() { // caller closed the channel return; } @@ -158,7 +149,7 @@ async fn livekit_handler( } } -async fn livekit_handler_inner( +fn livekit_handler_inner( transport_id: Entity, remote_address: &str, app_rx: Arc>>, diff --git a/crates/nft/src/lib.rs b/crates/nft/src/lib.rs index 4691d3eb..00ae65f6 100644 --- a/crates/nft/src/lib.rs +++ b/crates/nft/src/lib.rs @@ -164,7 +164,7 @@ fn load_frame( commands .entity(ent) .remove::() - .insert(FrameProcess(instance)) + .try_insert(FrameProcess(instance)) .try_push_children(&[child]); } } @@ -195,7 +195,7 @@ fn process_frame( commands .entity(spawned_ent) .remove::>() - .insert(new_mats.add(SceneMaterial { + .try_insert(new_mats.add(SceneMaterial { base: mat.clone(), extension: SceneBound::new(bounds.clone(), config.graphics.oob), })); diff --git a/crates/scene_runner/src/bounds_calc.rs b/crates/scene_runner/src/bounds_calc.rs index 4c0f0ab8..c59be995 100644 --- a/crates/scene_runner/src/bounds_calc.rs +++ b/crates/scene_runner/src/bounds_calc.rs @@ -74,11 +74,9 @@ pub fn scene_regions(parcels: impl Iterator) -> Vec { // gather horizontal loop { - let next_col = (0..=extent.y) - .map(|y| rect_base + IVec2::new(extent.x + 1, y)) - .collect::>(); - if next_col.iter().all(|p| region.contains(p)) { - for p in next_col { + let next_col = || (0..=extent.y).map(|y| rect_base + IVec2::new(extent.x + 1, y)); + if next_col().all(|p| region.contains(&p)) { + for p in next_col() { region.remove(&p); } extent.x += 1; diff --git a/crates/scene_runner/src/update_world/gltf_container.rs b/crates/scene_runner/src/update_world/gltf_container.rs index 7117e619..309fe8a8 100644 --- a/crates/scene_runner/src/update_world/gltf_container.rs +++ b/crates/scene_runner/src/update_world/gltf_container.rs @@ -649,7 +649,7 @@ fn update_ready_gltfs( // process collider let mut collider_base_name = maybe_name .map(Name::as_str) - .filter(|name| name.contains("_collider")); + .filter(|name| name.to_ascii_lowercase().contains("_collider")); if collider_base_name.is_none() { // check parent name also @@ -658,7 +658,7 @@ fn update_ready_gltfs( .ok() .and_then(|(name, ..)| name) .map(|name| name.as_str()) - .filter(|name| name.contains("_collider")) + .filter(|name| name.to_ascii_lowercase().contains("_collider")) } let is_collider = collider_base_name.is_some(); diff --git a/crates/scene_runner/src/update_world/scene_ui/mod.rs b/crates/scene_runner/src/update_world/scene_ui/mod.rs index 9df7dc1d..61c67ef2 100644 --- a/crates/scene_runner/src/update_world/scene_ui/mod.rs +++ b/crates/scene_runner/src/update_world/scene_ui/mod.rs @@ -66,8 +66,20 @@ macro_rules! val { match $pb.$u() { YgUnit::YguUndefined => $d, YgUnit::YguAuto => Val::Auto, - YgUnit::YguPoint => Val::Px($pb.$v), - YgUnit::YguPercent => Val::Percent($pb.$v), + YgUnit::YguPoint => { + if $pb.$v.is_nan() { + $d + } else { + Val::Px($pb.$v) + } + } + YgUnit::YguPercent => { + if $pb.$v.is_nan() { + $d + } else { + Val::Percent($pb.$v) + } + } } }; } @@ -87,8 +99,12 @@ macro_rules! maybe_val { match $pb.$u() { YgUnit::YguUndefined => None, YgUnit::YguAuto => Some(Val::Auto), - YgUnit::YguPoint => Some(Val::Px($pb.$v)), - YgUnit::YguPercent => Some(Val::Percent($pb.$v)), + YgUnit::YguPoint => Some(if $pb.$v.is_nan() { $d } else { Val::Px($pb.$v) }), + YgUnit::YguPercent => Some(if $pb.$v.is_nan() { + $d + } else { + Val::Percent($pb.$v) + }), } }; } diff --git a/crates/scene_runner/src/update_world/text_shape.rs b/crates/scene_runner/src/update_world/text_shape.rs index 7a201ac1..08dfe41f 100644 --- a/crates/scene_runner/src/update_world/text_shape.rs +++ b/crates/scene_runner/src/update_world/text_shape.rs @@ -691,6 +691,8 @@ pub fn make_text_section( _ => warn!("unrecognised text tag `{tag}`"), } section_start = section_start + close + 1; + } else { + break; } } @@ -713,7 +715,7 @@ pub fn make_text_section( let section_end = text[section_start..] .char_indices() .find(|(_, c)| *c == '<') - .map(|(ix, _)| section_start + ix) + .map(|(ix, _)| section_start + ix.max(1)) .unwrap_or(usize::MAX); let style = TextStyle { diff --git a/crates/social/src/client.rs b/crates/social/src/client.rs index ce60b531..14043709 100644 --- a/crates/social/src/client.rs +++ b/crates/social/src/client.rs @@ -1,7 +1,6 @@ use anyhow::anyhow; use bevy::{ log::{debug, warn}, - tasks::IoTaskPool, utils::{HashMap, HashSet}, }; use common::util::AsH160; @@ -128,9 +127,8 @@ impl SocialClientHandler { let (event_sx, event_rx) = mpsc::unbounded_channel(); let (response_sx, response_rx) = mpsc::unbounded_channel(); - IoTaskPool::get() - .spawn(social_socket_handler(wallet, event_rx, response_sx)) - .detach(); + std::thread::spawn(move || social_socket_handler(wallet, event_rx, response_sx)); + Some(Self { is_initialized: false, sender: event_sx, @@ -336,7 +334,7 @@ impl SocialClientHandler { } } -async fn social_socket_handler( +fn social_socket_handler( wallet: wallet::Wallet, event_rx: UnboundedReceiver, response_sx: UnboundedSender, diff --git a/crates/ui_core/src/combo_box.rs b/crates/ui_core/src/combo_box.rs index 4be33d51..7aae1d71 100644 --- a/crates/ui_core/src/combo_box.rs +++ b/crates/ui_core/src/combo_box.rs @@ -277,7 +277,9 @@ fn update_comboboxen( On::::new(close_ui_silent), On::::new(move |mut commands: Commands| { debug!("selected {ix:?}"); - commands.entity(popup.root).despawn_recursive(); + if let Some(commands) = commands.get_entity(popup.root) { + commands.despawn_recursive(); + } let Some(mut commands) = commands.get_entity(ent) else { warn!("no combo"); return;