mirror of
https://github.com/jhbruhn/jellyfin-radio.git
synced 2025-03-15 03:55:49 +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 |_| {
|
.map(move |_| {
|
||||||
let mut buffer = [0_i16; BUFFER_SIZE];
|
let mut buffer = [0_i16; BUFFER_SIZE];
|
||||||
renderer.on_start_of_batch();
|
renderer.on_start_of_batch();
|
||||||
|
tokio::task::block_in_place(|| {
|
||||||
buffer.fill_with(|| {
|
buffer.fill_with(|| {
|
||||||
let sample = renderer
|
let sample = renderer
|
||||||
.next_sample()
|
.next_sample()
|
||||||
|
@ -55,6 +56,7 @@ impl StreamerBackend {
|
||||||
};
|
};
|
||||||
sample
|
sample
|
||||||
});
|
});
|
||||||
|
});
|
||||||
Box::new(buffer)
|
Box::new(buffer)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue