diff options
Diffstat (limited to 'apps/codecs/aiff.c')
-rw-r--r-- | apps/codecs/aiff.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c index 479d405c41..d1bb14aa64 100644 --- a/apps/codecs/aiff.c +++ b/apps/codecs/aiff.c | |||
@@ -25,8 +25,6 @@ CODEC_HEADER | |||
25 | /* Macro that sign extends an unsigned byte */ | 25 | /* Macro that sign extends an unsigned byte */ |
26 | #define SE(x) ((int32_t)((int8_t)(x))) | 26 | #define SE(x) ((int32_t)((int8_t)(x))) |
27 | 27 | ||
28 | struct codec_api *rb; | ||
29 | |||
30 | /* This codec supports AIFF files with the following formats: | 28 | /* This codec supports AIFF files with the following formats: |
31 | * - PCM, 8, 16 and 24 bits, mono or stereo | 29 | * - PCM, 8, 16 and 24 bits, mono or stereo |
32 | */ | 30 | */ |
@@ -43,19 +41,10 @@ enum | |||
43 | /* for 44.1kHz stereo 16bits, this represents 0.023s ~= 1/50s */ | 41 | /* for 44.1kHz stereo 16bits, this represents 0.023s ~= 1/50s */ |
44 | #define AIF_CHUNK_SIZE (1024*2) | 42 | #define AIF_CHUNK_SIZE (1024*2) |
45 | 43 | ||
46 | #ifdef USE_IRAM | ||
47 | extern char iramcopy[]; | ||
48 | extern char iramstart[]; | ||
49 | extern char iramend[]; | ||
50 | extern char iedata[]; | ||
51 | extern char iend[]; | ||
52 | #endif | ||
53 | |||
54 | static int32_t samples[AIF_CHUNK_SIZE] IBSS_ATTR; | 44 | static int32_t samples[AIF_CHUNK_SIZE] IBSS_ATTR; |
55 | 45 | ||
56 | enum codec_status codec_start(struct codec_api *api) | 46 | enum codec_status codec_main(void) |
57 | { | 47 | { |
58 | struct codec_api *ci; | ||
59 | uint32_t numbytes, bytesdone; | 48 | uint32_t numbytes, bytesdone; |
60 | uint16_t num_channels = 0; | 49 | uint16_t num_channels = 0; |
61 | uint32_t num_sample_frames = 0; | 50 | uint32_t num_sample_frames = 0; |
@@ -73,20 +62,12 @@ enum codec_status codec_start(struct codec_api *api) | |||
73 | off_t firstblockposn; /* position of the first block in file */ | 62 | off_t firstblockposn; /* position of the first block in file */ |
74 | 63 | ||
75 | /* Generic codec initialisation */ | 64 | /* Generic codec initialisation */ |
76 | rb = api; | ||
77 | ci = api; | ||
78 | |||
79 | #ifdef USE_IRAM | ||
80 | ci->memcpy(iramstart, iramcopy, iramend - iramstart); | ||
81 | ci->memset(iedata, 0, iend - iedata); | ||
82 | #endif | ||
83 | |||
84 | ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); | 65 | ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); |
85 | ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); | 66 | ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); |
86 | ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); | 67 | ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); |
87 | 68 | ||
88 | next_track: | 69 | next_track: |
89 | if (codec_init(api)) { | 70 | if (codec_init()) { |
90 | i = CODEC_ERROR; | 71 | i = CODEC_ERROR; |
91 | goto exit; | 72 | goto exit; |
92 | } | 73 | } |