diff options
Diffstat (limited to 'apps/codecs/aiff.c')
-rw-r--r-- | apps/codecs/aiff.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c index 4e16788e06..4a127c7e0e 100644 --- a/apps/codecs/aiff.c +++ b/apps/codecs/aiff.c | |||
@@ -47,26 +47,18 @@ static const struct pcm_entry pcm_codecs[] = { | |||
47 | { AIFC_FORMAT_QT_IMA_ADPCM, get_qt_ima_adpcm_codec }, | 47 | { AIFC_FORMAT_QT_IMA_ADPCM, get_qt_ima_adpcm_codec }, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | #define NUM_FORMATS 6 | ||
51 | |||
52 | #define PCM_SAMPLE_SIZE (1024*2) | 50 | #define PCM_SAMPLE_SIZE (1024*2) |
53 | 51 | ||
54 | static int32_t samples[PCM_SAMPLE_SIZE] IBSS_ATTR; | 52 | static int32_t samples[PCM_SAMPLE_SIZE] IBSS_ATTR; |
55 | 53 | ||
56 | static const struct pcm_codec *get_codec(uint32_t formattag) | 54 | static const struct pcm_codec *get_codec(uint32_t formattag) |
57 | { | 55 | { |
58 | int i; | 56 | unsigned i; |
59 | 57 | for (i = 0; i < sizeof(pcm_codecs)/sizeof(pcm_codecs[0]); i++) | |
60 | for (i = 0; i < NUM_FORMATS; i++) | ||
61 | { | ||
62 | if (pcm_codecs[i].format_tag == formattag) | 58 | if (pcm_codecs[i].format_tag == formattag) |
63 | { | 59 | return pcm_codecs[i].get_codec(); |
64 | if (pcm_codecs[i].get_codec) | 60 | |
65 | return pcm_codecs[i].get_codec(); | 61 | return NULL; |
66 | return 0; | ||
67 | } | ||
68 | } | ||
69 | return 0; | ||
70 | } | 62 | } |
71 | 63 | ||
72 | enum codec_status codec_main(void) | 64 | enum codec_status codec_main(void) |
@@ -112,7 +104,7 @@ next_track: | |||
112 | 104 | ||
113 | if (memcmp(buf, "FORM", 4) != 0) | 105 | if (memcmp(buf, "FORM", 4) != 0) |
114 | { | 106 | { |
115 | DEBUGF("CODEC_ERROR: does not aiff format %c%c%c%c\n", buf[0], buf[1], buf[2], buf[3]); | 107 | DEBUGF("CODEC_ERROR: does not aiff format %4.4s\n", (char*)&buf[0]); |
116 | status = CODEC_ERROR; | 108 | status = CODEC_ERROR; |
117 | goto done; | 109 | goto done; |
118 | } | 110 | } |
@@ -122,7 +114,7 @@ next_track: | |||
122 | is_aifc = true; | 114 | is_aifc = true; |
123 | else | 115 | else |
124 | { | 116 | { |
125 | DEBUGF("CODEC_ERROR: does not aiff format %c%c%c%c\n", buf[8], buf[9], buf[10], buf[11]); | 117 | DEBUGF("CODEC_ERROR: does not aiff format %4.4s\n", (char*)&buf[8]); |
126 | status = CODEC_ERROR; | 118 | status = CODEC_ERROR; |
127 | goto done; | 119 | goto done; |
128 | } | 120 | } |