mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 20:17:04 +03:00
optimization for AAC-SBR
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -419,7 +419,11 @@ static int _i2s_write_frames(frames_t out_frames, bool silence, s32_t gainL, s32
|
|||||||
memcpy(obuf + oframes * BYTES_PER_FRAME, silencebuf, out_frames * BYTES_PER_FRAME);
|
memcpy(obuf + oframes * BYTES_PER_FRAME, silencebuf, out_frames * BYTES_PER_FRAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
output_visu_export(obuf + oframes * BYTES_PER_FRAME, out_frames, output.current_sample_rate, silence, (gainL + gainR) / 2);
|
// don't update visu if we don't have enough data in buffer
|
||||||
|
if (_buf_used(outputbuf) > outputbuf->size >> 2) {
|
||||||
|
output_visu_export(obuf + oframes * BYTES_PER_FRAME, out_frames, output.current_sample_rate, silence, (gainL + gainR) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
oframes += out_frames;
|
oframes += out_frames;
|
||||||
|
|
||||||
return out_frames;
|
return out_frames;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "squeezelite.h"
|
#include "squeezelite.h"
|
||||||
|
|
||||||
#define VISUEXPORT_SIZE 2048
|
#define VISUEXPORT_SIZE 512
|
||||||
|
|
||||||
EXT_BSS struct visu_export_s visu_export;
|
EXT_BSS struct visu_export_s visu_export;
|
||||||
static struct visu_export_s *visu = &visu_export;
|
static struct visu_export_s *visu = &visu_export;
|
||||||
@@ -37,7 +37,7 @@ void output_visu_export(void *frames, frames_t out_frames, u32_t rate, bool sile
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// do not block, try to stuff data put wait for consumer to have used them
|
// do not block, try to stuff data but wait for consumer to have used them
|
||||||
if (!pthread_mutex_trylock(&visu->mutex)) {
|
if (!pthread_mutex_trylock(&visu->mutex)) {
|
||||||
// don't mix sample rates
|
// don't mix sample rates
|
||||||
if (visu->rate != rate) visu->level = 0;
|
if (visu->rate != rate) visu->level = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user