diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-01-18 20:22:03 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-01-18 20:22:03 +0000 |
commit | 1060e447f83128a78dfaa8d59ba0baa642d15a4d (patch) | |
tree | 9af0876f9c5d0ad5cb8bfc2adc7b1653c43013ff /apps/codecs/aac.c | |
parent | 3ded3cea756d8290372b808884837931a7e8cf1a (diff) | |
download | rockbox-1060e447f83128a78dfaa8d59ba0baa642d15a4d.tar.gz rockbox-1060e447f83128a78dfaa8d59ba0baa642d15a4d.zip |
Part of the profiling patch to use a consistent return path in all codecs to facilitate 'on exit' functionality
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8374 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/aac.c')
-rw-r--r-- | apps/codecs/aac.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c index baa3935175..06a0e16527 100644 --- a/apps/codecs/aac.c +++ b/apps/codecs/aac.c | |||
@@ -72,7 +72,8 @@ enum codec_status codec_start(struct codec_api* api) | |||
72 | 72 | ||
73 | if (codec_init(api)) { | 73 | if (codec_init(api)) { |
74 | LOGF("FAAD: Error initialising codec\n"); | 74 | LOGF("FAAD: Error initialising codec\n"); |
75 | return CODEC_ERROR; | 75 | err = CODEC_ERROR; |
76 | goto exit; | ||
76 | } | 77 | } |
77 | 78 | ||
78 | while (!rb->taginfo_ready) | 79 | while (!rb->taginfo_ready) |
@@ -86,7 +87,8 @@ enum codec_status codec_start(struct codec_api* api) | |||
86 | * the movie data, which can be used directly by the decoder */ | 87 | * the movie data, which can be used directly by the decoder */ |
87 | if (!qtmovie_read(&input_stream, &demux_res)) { | 88 | if (!qtmovie_read(&input_stream, &demux_res)) { |
88 | LOGF("FAAD: Error initialising file\n"); | 89 | LOGF("FAAD: Error initialising file\n"); |
89 | return CODEC_ERROR; | 90 | err = CODEC_ERROR; |
91 | goto exit; | ||
90 | } | 92 | } |
91 | 93 | ||
92 | /* initialise the sound converter */ | 94 | /* initialise the sound converter */ |
@@ -95,7 +97,8 @@ enum codec_status codec_start(struct codec_api* api) | |||
95 | 97 | ||
96 | if (!hDecoder) { | 98 | if (!hDecoder) { |
97 | LOGF("FAAD: Error opening decoder\n"); | 99 | LOGF("FAAD: Error opening decoder\n"); |
98 | return CODEC_ERROR; | 100 | err = CODEC_ERROR; |
101 | goto exit; | ||
99 | } | 102 | } |
100 | 103 | ||
101 | NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration(hDecoder); | 104 | NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration(hDecoder); |
@@ -108,7 +111,8 @@ enum codec_status codec_start(struct codec_api* api) | |||
108 | err = NeAACDecInit2(hDecoder, demux_res.codecdata,demux_res.codecdata_len, &s, &c); | 111 | err = NeAACDecInit2(hDecoder, demux_res.codecdata,demux_res.codecdata_len, &s, &c); |
109 | if (err) { | 112 | if (err) { |
110 | LOGF("FAAD: Error initialising decoder: %d, type=%d\n", err,hDecoder->object_type); | 113 | LOGF("FAAD: Error initialising decoder: %d, type=%d\n", err,hDecoder->object_type); |
111 | return CODEC_ERROR; | 114 | err = CODEC_ERROR; |
115 | goto exit; | ||
112 | } | 116 | } |
113 | 117 | ||
114 | ci->id3->frequency=s; | 118 | ci->id3->frequency=s; |
@@ -137,7 +141,8 @@ enum codec_status codec_start(struct codec_api* api) | |||
137 | if (!get_sample_info(&demux_res, i, &sample_duration, | 141 | if (!get_sample_info(&demux_res, i, &sample_duration, |
138 | &sample_byte_size)) { | 142 | &sample_byte_size)) { |
139 | LOGF("AAC: Error in get_sample_info\n"); | 143 | LOGF("AAC: Error in get_sample_info\n"); |
140 | return CODEC_ERROR; | 144 | err = CODEC_ERROR; |
145 | goto exit; | ||
141 | } | 146 | } |
142 | 147 | ||
143 | /* Request the required number of bytes from the input buffer */ | 148 | /* Request the required number of bytes from the input buffer */ |
@@ -150,7 +155,8 @@ enum codec_status codec_start(struct codec_api* api) | |||
150 | decoder struct directly */ | 155 | decoder struct directly */ |
151 | if (frameInfo.error > 0) { | 156 | if (frameInfo.error > 0) { |
152 | LOGF("FAAD: decoding error \"%s\"\n", NeAACDecGetErrorMessage(frameInfo.error)); | 157 | LOGF("FAAD: decoding error \"%s\"\n", NeAACDecGetErrorMessage(frameInfo.error)); |
153 | return CODEC_ERROR; | 158 | err = CODEC_ERROR; |
159 | goto exit; | ||
154 | } | 160 | } |
155 | 161 | ||
156 | /* Get the number of decoded samples */ | 162 | /* Get the number of decoded samples */ |
@@ -182,5 +188,7 @@ enum codec_status codec_start(struct codec_api* api) | |||
182 | if (ci->request_next_track()) | 188 | if (ci->request_next_track()) |
183 | goto next_track; | 189 | goto next_track; |
184 | 190 | ||
185 | return CODEC_OK; | 191 | err = CODEC_OK; |
192 | exit: | ||
193 | return err; | ||
186 | } | 194 | } |