summaryrefslogtreecommitdiff
path: root/apps/codecs/wavpack.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/wavpack.c')
-rw-r--r--apps/codecs/wavpack.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c
index ee21347b73..febea1e705 100644
--- a/apps/codecs/wavpack.c
+++ b/apps/codecs/wavpack.c
@@ -26,11 +26,11 @@ static struct codec_api *ci;
26 26
27#define BUFFER_SIZE 4096 27#define BUFFER_SIZE 4096
28 28
29static long temp_buffer [BUFFER_SIZE] IBSS_ATTR; 29static int32_t temp_buffer [BUFFER_SIZE] IBSS_ATTR;
30 30
31static long read_callback (void *buffer, long bytes) 31static int32_t read_callback (void *buffer, int32_t bytes)
32{ 32{
33 long retval = ci->read_filebuf (buffer, bytes); 33 int32_t retval = ci->read_filebuf (buffer, bytes);
34 ci->id3->offset = ci->curpos; 34 ci->id3->offset = ci->curpos;
35 return retval; 35 return retval;
36} 36}
@@ -63,7 +63,7 @@ enum codec_status codec_start(struct codec_api* api)
63 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*128)); 63 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*128));
64 64
65 ci->configure(DSP_DITHER, (bool *)false); 65 ci->configure(DSP_DITHER, (bool *)false);
66 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(27)); // should be 28... 66 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(28));
67 67
68 next_track: 68 next_track:
69 69
@@ -97,7 +97,7 @@ enum codec_status codec_start(struct codec_api* api)
97 /* The main decoder loop */ 97 /* The main decoder loop */
98 98
99 while (1) { 99 while (1) {
100 long nsamples; 100 int32_t nsamples;
101 101
102 if (ci->seek_time && ci->taginfo_ready && ci->id3->length) { 102 if (ci->seek_time && ci->taginfo_ready && ci->id3->length) {
103 ci->seek_time--; 103 ci->seek_time--;
@@ -107,13 +107,13 @@ enum codec_status codec_start(struct codec_api* api)
107 if (ci->seek_time > curpos_ms) { 107 if (ci->seek_time > curpos_ms) {
108 n = ci->seek_time - curpos_ms; 108 n = ci->seek_time - curpos_ms;
109 d = ci->id3->length - curpos_ms; 109 d = ci->id3->length - curpos_ms;
110 skip = (int)((long long)(ci->filesize - ci->curpos) * n / d); 110 skip = (int)((int64_t)(ci->filesize - ci->curpos) * n / d);
111 ci->seek_buffer (ci->curpos + skip); 111 ci->seek_buffer (ci->curpos + skip);
112 } 112 }
113 else { 113 else {
114 n = curpos_ms - ci->seek_time; 114 n = curpos_ms - ci->seek_time;
115 d = curpos_ms; 115 d = curpos_ms;
116 skip = (int)((long long) ci->curpos * n / d); 116 skip = (int)((int64_t) ci->curpos * n / d);
117 ci->seek_buffer (ci->curpos - skip); 117 ci->seek_buffer (ci->curpos - skip);
118 } 118 }
119 119