mirror of
https://github.com/jhbruhn/jellyfin-radio.git
synced 2025-03-14 19:45:50 +00:00
Improve performance of blocking
This commit is contained in:
parent
54c987e784
commit
1d4c93b4da
1 changed files with 18 additions and 16 deletions
|
@ -41,6 +41,7 @@ impl StreamerBackend {
|
|||
.map(move |_| {
|
||||
let mut buffer = [0_i16; BUFFER_SIZE];
|
||||
renderer.on_start_of_batch();
|
||||
tokio::task::block_in_place(|| {
|
||||
buffer.fill_with(|| {
|
||||
let sample = renderer
|
||||
.next_sample()
|
||||
|
@ -55,6 +56,7 @@ impl StreamerBackend {
|
|||
};
|
||||
sample
|
||||
});
|
||||
});
|
||||
Box::new(buffer)
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue