summaryrefslogtreecommitdiff
path: root/apps/codecs/alac.c
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-01-18 20:22:03 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-01-18 20:22:03 +0000
commit1060e447f83128a78dfaa8d59ba0baa642d15a4d (patch)
tree9af0876f9c5d0ad5cb8bfc2adc7b1653c43013ff /apps/codecs/alac.c
parent3ded3cea756d8290372b808884837931a7e8cf1a (diff)
downloadrockbox-1060e447f83128a78dfaa8d59ba0baa642d15a4d.zip
rockbox-1060e447f83128a78dfaa8d59ba0baa642d15a4d.tar.gz
rockbox-1060e447f83128a78dfaa8d59ba0baa642d15a4d.tar.bz2
rockbox-1060e447f83128a78dfaa8d59ba0baa642d15a4d.tar.xz
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/alac.c')
-rw-r--r--apps/codecs/alac.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c
index 7ca70ce..a1c4f41 100644
--- a/apps/codecs/alac.c
+++ b/apps/codecs/alac.c
@@ -50,6 +50,7 @@ enum codec_status codec_start(struct codec_api* api)
unsigned int i;
unsigned char* buffer;
alac_file alac;
+ int retval;
/* Generic codec initialisation */
rb = api;
@@ -72,7 +73,8 @@ enum codec_status codec_start(struct codec_api* api)
if (codec_init(api)) {
LOGF("ALAC: Error initialising codec\n");
- return CODEC_ERROR;
+ retval = CODEC_ERROR;
+ goto exit;
}
while (!rb->taginfo_ready)
@@ -86,7 +88,8 @@ enum codec_status codec_start(struct codec_api* api)
* the movie data, which can be used directly by the decoder */
if (!qtmovie_read(&input_stream, &demux_res)) {
LOGF("ALAC: Error initialising file\n");
- return CODEC_ERROR;
+ retval = CODEC_ERROR;
+ goto exit;
}
/* initialise the sound converter */
@@ -117,14 +120,16 @@ enum codec_status codec_start(struct codec_api* api)
if (!get_sample_info(&demux_res, i, &sample_duration,
&sample_byte_size)) {
LOGF("ALAC: Error in get_sample_info\n");
- return CODEC_ERROR;
+ retval = CODEC_ERROR;
+ goto exit;
}
/* Request the required number of bytes from the input buffer */
buffer=ci->request_buffer((long*)&n,sample_byte_size);
if (n!=sample_byte_size) {
- return CODEC_ERROR;
+ retval = CODEC_ERROR;
+ goto exit;
}
/* Decode one block - returned samples will be host-endian */
@@ -157,5 +162,7 @@ enum codec_status codec_start(struct codec_api* api)
if (ci->request_next_track())
goto next_track;
- return CODEC_OK;
+ retval = CODEC_OK;
+exit:
+ return retval;
}