mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-29 22:00:54 +03:00
more aac correction - release
This commit is contained in:
@@ -358,7 +358,7 @@ static decode_state alac_decode(void) {
|
|||||||
return DECODE_COMPLETE;
|
return DECODE_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// enough data for coding
|
// is there enough data for decoding
|
||||||
if (bytes < block_size) {
|
if (bytes < block_size) {
|
||||||
UNLOCK_S;
|
UNLOCK_S;
|
||||||
return DECODE_RUNNING;
|
return DECODE_RUNNING;
|
||||||
|
|||||||
@@ -389,19 +389,25 @@ static decode_state helixaac_decode(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (found == 1) {
|
if (found == 1) {
|
||||||
|
|
||||||
LOG_INFO("samplerate: %u channels: %u", samplerate, channels);
|
|
||||||
bytes_total = _buf_used(streambuf);
|
|
||||||
bytes_wrap = min(bytes_total, _buf_cont_read(streambuf));
|
|
||||||
|
|
||||||
LOCK_O;
|
LOCK_O;
|
||||||
LOG_INFO("setting track_start");
|
|
||||||
output.next_sample_rate = decode_newstream(samplerate, output.supported_rates);
|
output.next_sample_rate = decode_newstream(samplerate, output.supported_rates);
|
||||||
IF_DSD( output.next_fmt = PCM; )
|
IF_DSD( output.next_fmt = PCM; )
|
||||||
output.track_start = outputbuf->writep;
|
output.track_start = outputbuf->writep;
|
||||||
if (output.fade_mode) _checkfade(true);
|
if (output.fade_mode) _checkfade(true);
|
||||||
decode.new_stream = false;
|
decode.new_stream = false;
|
||||||
UNLOCK_O;
|
UNLOCK_O;
|
||||||
|
|
||||||
|
LOG_INFO("setting track start, samplerate: %u channels: %u", samplerate, channels);
|
||||||
|
|
||||||
|
bytes_total = _buf_used(streambuf);
|
||||||
|
bytes_wrap = min(bytes_total, _buf_cont_read(streambuf));
|
||||||
|
|
||||||
|
// come back later if we don' thave enough data
|
||||||
|
if (bytes_total < WRAPBUF_LEN) {
|
||||||
|
UNLOCK_S;
|
||||||
|
LOG_INFO("need more audio data");
|
||||||
|
return DECODE_RUNNING;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (found == -1) {
|
} else if (found == -1) {
|
||||||
|
|
||||||
@@ -418,8 +424,9 @@ static decode_state helixaac_decode(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bytes_wrap < WRAPBUF_LEN && (bytes_total > WRAPBUF_LEN || stream.state <= DISCONNECT)) {
|
// we always have at least WRAPBUF_LEN unless it's the end of a stream
|
||||||
// make a local copy of frames which may have wrapped round the end of streambuf
|
if (bytes_wrap < WRAPBUF_LEN) {
|
||||||
|
// build a linear buffer if we are crossing the end of streambuf
|
||||||
memcpy(a->wrap_buf, streambuf->readp, bytes_wrap);
|
memcpy(a->wrap_buf, streambuf->readp, bytes_wrap);
|
||||||
memcpy(a->wrap_buf + bytes_wrap, streambuf->buf, min(WRAPBUF_LEN, bytes_total) - bytes_wrap);
|
memcpy(a->wrap_buf + bytes_wrap, streambuf->buf, min(WRAPBUF_LEN, bytes_total) - bytes_wrap);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user