| 709 | // before decode completes. |
| 710 | LOG_DEBUG(Audio, "WaveOAL::KickAsyncLoad async-dispatch: {} ({} bytes)", |
| 711 | static_cast<const char*>(Name()), _state.size); |
| 712 | AddRef(); |
| 713 | pool->Submit([this]() |
| 714 | { |
| 715 | DecodePcm(); |
| 716 | Release(); |
| 717 | }); |
| 718 | } |
| 719 | |
| 720 | void WaveOAL::Load() |
| 721 | { |
| 722 | if (!_stream || _loaded || _loadError) |
| 723 | return; |
| 724 | |
| 725 | // Phase A measurement. `WaveOAL::Load` is the dominant cause of |
| 726 | // the first-touch hitch in the demo intro (full Vorbis decode of |
| 727 | // a music track lands here synchronously on the main thread). |
| 728 | // Phase 3c split this into Decode (worker-safe) + Upload (main- |
| 729 | // thread). This wrapper preserves the synchronous contract so |
| 730 | // the lazy-load-on-DoPlay call site keeps working unchanged. |
| 731 | // Phase 3d will route around this wrapper to dispatch Decode |
| 732 | // asynchronously while leaving Upload synchronous on Commit. |
| 733 | const auto _perfLoadStart = ::Poseidon::Dev::Perf::Now(); |
| 734 | |
| 735 | DecodePcm(); |
| 736 | if (_loadError) |
| 737 | { |
| 738 | return; |
| 739 | } |
| 740 | UploadAlBuffer(); |
| 741 | if (_loadError) |
| 742 | { |
| 743 | return; |
| 744 | } |
| 745 |
no test coverage detected