summaryrefslogtreecommitdiff
path: root/apps/codecs/vorbis.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/vorbis.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/vorbis.c')
-rw-r--r--apps/codecs/vorbis.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/codecs/vorbis.c b/apps/codecs/vorbis.c
index fdd7a95..e77ecad 100644
--- a/apps/codecs/vorbis.c
+++ b/apps/codecs/vorbis.c
@@ -145,11 +145,11 @@ enum codec_status codec_start(struct codec_api *api)
*/
rb->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(1024*256));
-
/* We need to flush reserver memory every track load. */
next_track:
if (codec_init(rb)) {
- return CODEC_ERROR;
+ error = CODEC_ERROR;
+ goto exit;
}
while (!*rb->taginfo_ready && !rb->stop_codec)
@@ -195,7 +195,8 @@ next_track:
vf.links = 1;
} else {
//rb->logf("ov_open: %d", error);
- return CODEC_ERROR;
+ error = CODEC_ERROR;
+ goto exit;
}
if (rb->id3->offset) {
@@ -224,7 +225,8 @@ next_track:
/* Change DSP and buffer settings for this bitstream */
if (current_section != previous_section) {
if (!vorbis_set_codec_parameters(&vf)) {
- return CODEC_ERROR;
+ error = CODEC_ERROR;
+ goto exit;
} else {
previous_section = current_section;
}
@@ -255,6 +257,8 @@ next_track:
goto next_track;
}
- return CODEC_OK;
+ error = CODEC_OK;
+exit:
+ return error;
}