diff options
Diffstat (limited to 'apps/codecs/alac.c')
-rw-r--r-- | apps/codecs/alac.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c index 428fc59836..cd9129a278 100644 --- a/apps/codecs/alac.c +++ b/apps/codecs/alac.c | |||
@@ -25,6 +25,10 @@ | |||
25 | 25 | ||
26 | CODEC_HEADER | 26 | CODEC_HEADER |
27 | 27 | ||
28 | /* The maximum buffer size handled. This amount of bytes is buffered for each | ||
29 | * frame. */ | ||
30 | #define ALAC_BYTE_BUFFER_SIZE 32768 | ||
31 | |||
28 | static int32_t outputbuffer[ALAC_MAX_CHANNELS][ALAC_BLOCKSIZE] IBSS_ATTR; | 32 | static int32_t outputbuffer[ALAC_MAX_CHANNELS][ALAC_BLOCKSIZE] IBSS_ATTR; |
29 | 33 | ||
30 | /* this is the codec entry point */ | 34 | /* this is the codec entry point */ |
@@ -83,7 +87,7 @@ enum codec_status codec_main(void) | |||
83 | /* Set i for first frame, seek to desired sample position for resuming. */ | 87 | /* Set i for first frame, seek to desired sample position for resuming. */ |
84 | i=0; | 88 | i=0; |
85 | if (samplesdone > 0) { | 89 | if (samplesdone > 0) { |
86 | if (alac_seek(&demux_res, &input_stream, samplesdone, | 90 | if (m4a_seek(&demux_res, &input_stream, samplesdone, |
87 | &samplesdone, (int*) &i)) { | 91 | &samplesdone, (int*) &i)) { |
88 | elapsedtime = (samplesdone * 10) / (ci->id3->frequency / 100); | 92 | elapsedtime = (samplesdone * 10) / (ci->id3->frequency / 100); |
89 | ci->set_elapsed(elapsedtime); | 93 | ci->set_elapsed(elapsedtime); |
@@ -101,7 +105,7 @@ enum codec_status codec_main(void) | |||
101 | 105 | ||
102 | /* Deal with any pending seek requests */ | 106 | /* Deal with any pending seek requests */ |
103 | if (ci->seek_time) { | 107 | if (ci->seek_time) { |
104 | if (alac_seek(&demux_res, &input_stream, | 108 | if (m4a_seek(&demux_res, &input_stream, |
105 | ((ci->seek_time-1)/10) * (ci->id3->frequency/100), | 109 | ((ci->seek_time-1)/10) * (ci->id3->frequency/100), |
106 | &samplesdone, (int *)&i)) { | 110 | &samplesdone, (int *)&i)) { |
107 | elapsedtime=(samplesdone*10)/(ci->id3->frequency/100); | 111 | elapsedtime=(samplesdone*10)/(ci->id3->frequency/100); |
@@ -111,11 +115,7 @@ enum codec_status codec_main(void) | |||
111 | } | 115 | } |
112 | 116 | ||
113 | /* Request the required number of bytes from the input buffer */ | 117 | /* Request the required number of bytes from the input buffer */ |
114 | buffer=ci->request_buffer(&n, demux_res.sample_byte_size[i]); | 118 | buffer=ci->request_buffer(&n, ALAC_BYTE_BUFFER_SIZE); |
115 | if (n!=demux_res.sample_byte_size[i]) { | ||
116 | retval = CODEC_ERROR; | ||
117 | goto done; | ||
118 | } | ||
119 | 119 | ||
120 | /* Decode one block - returned samples will be host-endian */ | 120 | /* Decode one block - returned samples will be host-endian */ |
121 | ci->yield(); | 121 | ci->yield(); |