diff options
Diffstat (limited to 'apps/codecs/tta.c')
-rw-r--r-- | apps/codecs/tta.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/codecs/tta.c b/apps/codecs/tta.c index 2d531315a2..1d0846ea61 100644 --- a/apps/codecs/tta.c +++ b/apps/codecs/tta.c | |||
@@ -37,7 +37,7 @@ static int32_t samples[PCM_BUFFER_LENGTH * 2] IBSS_ATTR; | |||
37 | enum codec_status codec_main(void) | 37 | enum codec_status codec_main(void) |
38 | { | 38 | { |
39 | tta_info info; | 39 | tta_info info; |
40 | int status = CODEC_OK; | 40 | int status; |
41 | unsigned int decodedsamples; | 41 | unsigned int decodedsamples; |
42 | int endofstream; | 42 | int endofstream; |
43 | int new_pos = 0; | 43 | int new_pos = 0; |
@@ -47,6 +47,8 @@ enum codec_status codec_main(void) | |||
47 | ci->configure(DSP_SET_SAMPLE_DEPTH, TTA_OUTPUT_DEPTH - 1); | 47 | ci->configure(DSP_SET_SAMPLE_DEPTH, TTA_OUTPUT_DEPTH - 1); |
48 | 48 | ||
49 | next_track: | 49 | next_track: |
50 | status = CODEC_OK; | ||
51 | |||
50 | if (codec_init()) | 52 | if (codec_init()) |
51 | { | 53 | { |
52 | DEBUGF("codec_init() error\n"); | 54 | DEBUGF("codec_init() error\n"); |
@@ -54,8 +56,8 @@ next_track: | |||
54 | goto exit; | 56 | goto exit; |
55 | } | 57 | } |
56 | 58 | ||
57 | while (!*ci->taginfo_ready && !ci->stop_codec) | 59 | if (codec_wait_taginfo() != 0) |
58 | ci->sleep(1); | 60 | goto done; |
59 | 61 | ||
60 | if (set_tta_info(&info) < 0 || player_init(&info) < 0) | 62 | if (set_tta_info(&info) < 0 || player_init(&info) < 0) |
61 | { | 63 | { |
@@ -117,7 +119,7 @@ next_track: | |||
117 | endofstream = 1; | 119 | endofstream = 1; |
118 | ci->set_elapsed((uint64_t)info.LENGTH * 1000 * decodedsamples / info.DATALENGTH); | 120 | ci->set_elapsed((uint64_t)info.LENGTH * 1000 * decodedsamples / info.DATALENGTH); |
119 | } | 121 | } |
120 | status = CODEC_OK; | 122 | |
121 | done: | 123 | done: |
122 | player_stop(); | 124 | player_stop(); |
123 | if (ci->request_next_track()) | 125 | if (ci->request_next_track()) |