issue 86: change decode state machine to avoid restarting track decode when complete
Adrian Smith
9 years ago
73 | 73 |
SOXR(r, process, r->resampler, process->inbuf, process->in_frames, &idone, process->outbuf, process->max_out_frames, &odone);
|
74 | 74 |
if (error) {
|
75 | 75 |
LOG_INFO("soxr_process error: %s", soxr_strerror(error));
|
|
76 |
return;
|
76 | 77 |
}
|
77 | 78 |
|
78 | 79 |
if (idone != process->in_frames) {
|
|
99 | 100 |
soxr_error_t error = SOXR(r, process, r->resampler, NULL, 0, NULL, process->outbuf, process->max_out_frames, &odone);
|
100 | 101 |
if (error) {
|
101 | 102 |
LOG_INFO("soxr_process error: %s", soxr_strerror(error));
|
|
103 |
return true;
|
102 | 104 |
}
|
103 | 105 |
|
104 | 106 |
process->out_frames = odone;
|
279 | 279 |
output.state = jiffies ? OUTPUT_START_AT : OUTPUT_RUNNING;
|
280 | 280 |
output.start_at = jiffies;
|
281 | 281 |
UNLOCK_O;
|
282 | |
LOCK_D;
|
283 | |
decode.state = DECODE_RUNNING;
|
284 | |
UNLOCK_D;
|
285 | 282 |
LOG_DEBUG("unpause at: %u now: %u", jiffies, gettime_ms());
|
286 | 283 |
sendSTAT("STMr", 0);
|
287 | 284 |
}
|
|
629 | 626 |
status.last = now;
|
630 | 627 |
}
|
631 | 628 |
if ((status.stream_state == STREAMING_HTTP || status.stream_state == STREAMING_FILE) && !sentSTMl
|
632 | |
&& decode.state == DECODE_STOPPED) {
|
|
629 |
&& decode.state == DECODE_READY) {
|
633 | 630 |
if (autostart == 0) {
|
|
631 |
decode.state = DECODE_RUNNING;
|
634 | 632 |
_sendSTMl = true;
|
635 | 633 |
sentSTMl = true;
|
636 | 634 |
} else if (autostart == 1) {
|
19 | 19 |
|
20 | 20 |
// make may define: PORTAUDIO, SELFPIPE, RESAMPLE, RESAMPLE_MP, VISEXPORT, DSD, LINKALL to influence build
|
21 | 21 |
|
22 | |
#define VERSION "v1.7"
|
|
22 |
#define VERSION "v1.7.1-beta"
|
23 | 23 |
|
24 | 24 |
#if !defined(MODEL_NAME)
|
25 | 25 |
#define MODEL_NAME SqueezeLite
|
|
447 | 447 |
bool stream_disconnect(void);
|
448 | 448 |
|
449 | 449 |
// decode.c
|
450 | |
typedef enum { DECODE_STOPPED = 0, DECODE_RUNNING, DECODE_COMPLETE, DECODE_ERROR } decode_state;
|
|
450 |
typedef enum { DECODE_STOPPED = 0, DECODE_READY, DECODE_RUNNING, DECODE_COMPLETE, DECODE_ERROR } decode_state;
|
451 | 451 |
|
452 | 452 |
struct decodestate {
|
453 | 453 |
decode_state state;
|