Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2002 Björn Stenberg |
| 11 | * |
| 12 | * All files in this archive are subject to the GNU General Public License. |
| 13 | * See the file COPYING in the source tree root for full license agreement. |
| 14 | * |
| 15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 16 | * KIND, either express or implied. |
| 17 | * |
| 18 | ****************************************************************************/ |
Thom Johansen | c91e0bb | 2005-10-13 11:32:52 +0000 | [diff] [blame] | 19 | |
| 20 | #include "codeclib.h" |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 21 | #include "Tremor/ivorbisfile.h" |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 22 | #include "Tremor/ogg.h" |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 23 | |
Jens Arnold | b8749fd | 2006-01-18 00:05:14 +0000 | [diff] [blame] | 24 | CODEC_HEADER |
| 25 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 26 | static struct codec_api *rb; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 27 | |
| 28 | /* Some standard functions and variables needed by Tremor */ |
| 29 | |
| 30 | int errno; |
| 31 | |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 32 | size_t read_handler(void *ptr, size_t size, size_t nmemb, void *datasource) |
| 33 | { |
Daniel Stenberg | 31efab4 | 2005-06-22 19:55:09 +0000 | [diff] [blame] | 34 | (void)datasource; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 35 | return rb->read_filebuf(ptr, nmemb*size); |
| 36 | } |
| 37 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 38 | int initial_seek_handler(void *datasource, ogg_int64_t offset, int whence) |
| 39 | { |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 40 | (void)datasource; |
| 41 | (void)offset; |
| 42 | (void)whence; |
| 43 | return -1; |
| 44 | } |
| 45 | |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 46 | int seek_handler(void *datasource, ogg_int64_t offset, int whence) |
| 47 | { |
| 48 | (void)datasource; |
| 49 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 50 | if (whence == SEEK_CUR) { |
| 51 | offset += rb->curpos; |
| 52 | } else if (whence == SEEK_END) { |
| 53 | offset += rb->filesize; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | if (rb->seek_buffer(offset)) { |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 57 | return 0; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | return -1; |
| 61 | } |
| 62 | |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 63 | int close_handler(void *datasource) |
| 64 | { |
| 65 | (void)datasource; |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | long tell_handler(void *datasource) |
| 70 | { |
Daniel Stenberg | 31efab4 | 2005-06-22 19:55:09 +0000 | [diff] [blame] | 71 | (void)datasource; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 72 | return rb->curpos; |
| 73 | } |
| 74 | |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 75 | /* This sets the DSP parameters based on the current logical bitstream |
| 76 | * (sampling rate, number of channels, etc). It also tries to guess |
| 77 | * reasonable buffer parameters based on the current quality setting. |
| 78 | */ |
| 79 | bool vorbis_set_codec_parameters(OggVorbis_File *vf) |
| 80 | { |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 81 | vorbis_info *vi; |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 82 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 83 | vi = ov_info(vf, -1); |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 84 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 85 | if (vi == NULL) { |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 86 | //rb->splash(HZ*2, true, "Vorbis Error"); |
| 87 | return false; |
| 88 | } |
| 89 | |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 90 | rb->configure(DSP_SET_FREQUENCY, (int *)rb->id3->frequency); |
Magnus Holmgren | 4a53787 | 2005-07-24 15:32:28 +0000 | [diff] [blame] | 91 | codec_set_replaygain(rb->id3); |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 92 | |
| 93 | if (vi->channels == 2) { |
Magnus Holmgren | 4a53787 | 2005-07-24 15:32:28 +0000 | [diff] [blame] | 94 | rb->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED); |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 95 | } else if (vi->channels == 1) { |
| 96 | rb->configure(DSP_SET_STEREO_MODE, (int *)STEREO_MONO); |
| 97 | } |
| 98 | |
| 99 | return true; |
| 100 | } |
| 101 | |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 102 | #ifdef USE_IRAM |
| 103 | extern char iramcopy[]; |
| 104 | extern char iramstart[]; |
| 105 | extern char iramend[]; |
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 106 | extern char iedata[]; |
| 107 | extern char iend[]; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 108 | #endif |
| 109 | |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 110 | /* this is the codec entry point */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 111 | enum codec_status codec_start(struct codec_api *api) |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 112 | { |
| 113 | ov_callbacks callbacks; |
| 114 | OggVorbis_File vf; |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 115 | ogg_int32_t **pcm; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 116 | |
| 117 | int error; |
| 118 | long n; |
| 119 | int current_section; |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 120 | int previous_section = -1; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 121 | int eof; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 122 | ogg_int64_t vf_offsets[2]; |
| 123 | ogg_int64_t vf_dataoffsets; |
| 124 | ogg_uint32_t vf_serialnos; |
| 125 | ogg_int64_t vf_pcmlengths[2]; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 126 | |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 127 | rb = api; |
| 128 | |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 129 | #ifdef USE_IRAM |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 130 | rb->memcpy(iramstart, iramcopy, iramend - iramstart); |
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 131 | rb->memset(iedata, 0, iend - iedata); |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 132 | #endif |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 133 | |
Magnus Holmgren | 4a53787 | 2005-07-24 15:32:28 +0000 | [diff] [blame] | 134 | rb->configure(CODEC_DSP_ENABLE, (bool *)true); |
| 135 | rb->configure(DSP_DITHER, (bool *)false); |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 136 | rb->configure(DSP_SET_SAMPLE_DEPTH, (long *)24); |
| 137 | rb->configure(DSP_SET_CLIP_MAX, (long *)((1 << 24) - 1)); |
| 138 | rb->configure(DSP_SET_CLIP_MIN, (long *)-((1 << 24) - 1)); |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 139 | /* Note: These are sane defaults for these values. Perhaps |
| 140 | * they should be set differently based on quality setting |
| 141 | */ |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 142 | |
| 143 | /* The chunk size below is magic. If set any lower, resume |
| 144 | * doesn't work properly (ov_raw_seek() does the wrong thing). |
| 145 | */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 146 | rb->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(1024*256)); |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 147 | |
Miika Pekkarinen | d8cb703 | 2005-06-26 19:41:29 +0000 | [diff] [blame] | 148 | /* We need to flush reserver memory every track load. */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 149 | next_track: |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 150 | if (codec_init(rb)) { |
Brandon Low | 1060e44 | 2006-01-18 20:22:03 +0000 | [diff] [blame] | 151 | error = CODEC_ERROR; |
| 152 | goto exit; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 153 | } |
| 154 | |
Miika Pekkarinen | 0d63cbb | 2005-07-10 20:37:36 +0000 | [diff] [blame] | 155 | while (!*rb->taginfo_ready && !rb->stop_codec) |
Miika Pekkarinen | fbd4088 | 2005-07-11 18:47:47 +0000 | [diff] [blame] | 156 | rb->sleep(1); |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 157 | |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 158 | /* Create a decoder instance */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 159 | callbacks.read_func = read_handler; |
| 160 | callbacks.seek_func = initial_seek_handler; |
| 161 | callbacks.tell_func = tell_handler; |
| 162 | callbacks.close_func = close_handler; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 163 | |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 164 | /* Open a non-seekable stream */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 165 | error = ov_open_callbacks(rb, &vf, NULL, 0, callbacks); |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 166 | |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 167 | /* If the non-seekable open was successful, we need to supply the missing |
| 168 | * data to make it seekable. This is a hack, but it's reasonable since we |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 169 | * don't want to run the whole file through the buffer before we start |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 170 | * playing. Using Tremor's seekable open routine would cause us to do |
| 171 | * this, so we pretend not to be seekable at first. Then we fill in the |
| 172 | * missing fields of vf with 1) information in rb->id3, and 2) info |
| 173 | * obtained by Tremor in the above ov_open call. |
| 174 | * |
| 175 | * Note that this assumes there is only ONE logical Vorbis bitstream in our |
| 176 | * physical Ogg bitstream. This is verified in metadata.c, well before we |
| 177 | * get here. |
| 178 | */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 179 | if (!error) { |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 180 | vf.offsets = vf_offsets; |
| 181 | vf.dataoffsets = &vf_dataoffsets; |
| 182 | vf.serialnos = &vf_serialnos; |
| 183 | vf.pcmlengths = vf_pcmlengths; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 184 | |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 185 | vf.offsets[0] = 0; |
| 186 | vf.offsets[1] = rb->id3->filesize; |
| 187 | vf.dataoffsets[0] = vf.offset; |
| 188 | vf.pcmlengths[0] = 0; |
| 189 | vf.pcmlengths[1] = rb->id3->samples; |
| 190 | vf.serialnos[0] = vf.current_serialno; |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 191 | vf.callbacks.seek_func = seek_handler; |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 192 | vf.seekable = 1; |
| 193 | vf.end = rb->id3->filesize; |
| 194 | vf.ready_state = OPENED; |
| 195 | vf.links = 1; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 196 | } else { |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 197 | //rb->logf("ov_open: %d", error); |
Brandon Low | 1060e44 | 2006-01-18 20:22:03 +0000 | [diff] [blame] | 198 | error = CODEC_ERROR; |
| 199 | goto exit; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 200 | } |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 201 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 202 | if (rb->id3->offset) { |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 203 | rb->advance_buffer(rb->id3->offset); |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 204 | ov_raw_seek(&vf, rb->id3->offset); |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 205 | rb->set_elapsed(ov_time_tell(&vf)); |
Ryan Jackson | d191756 | 2005-07-12 16:45:38 +0000 | [diff] [blame] | 206 | rb->set_offset(ov_raw_tell(&vf)); |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 207 | } |
| 208 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 209 | eof = 0; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 210 | while (!eof) { |
Ryan Jackson | 4d45987 | 2005-07-14 03:58:22 +0000 | [diff] [blame] | 211 | rb->yield(); |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 212 | if (rb->stop_codec || rb->reload_codec) |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 213 | break; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 214 | |
| 215 | if (rb->seek_time) { |
Thom Johansen | c8193b8 | 2005-11-06 19:18:04 +0000 | [diff] [blame] | 216 | if (ov_time_seek(&vf, rb->seek_time - 1)) { |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 217 | //rb->logf("ov_time_seek failed"); |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 218 | } |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 219 | rb->seek_complete(); |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 220 | } |
Magnus Holmgren | 4a53787 | 2005-07-24 15:32:28 +0000 | [diff] [blame] | 221 | |
| 222 | /* Read host-endian signed 24-bit PCM samples */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 223 | n = ov_read_fixed(&vf, &pcm, 1024, ¤t_section); |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 224 | |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 225 | /* Change DSP and buffer settings for this bitstream */ |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 226 | if (current_section != previous_section) { |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 227 | if (!vorbis_set_codec_parameters(&vf)) { |
Brandon Low | 1060e44 | 2006-01-18 20:22:03 +0000 | [diff] [blame] | 228 | error = CODEC_ERROR; |
| 229 | goto exit; |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 230 | } else { |
| 231 | previous_section = current_section; |
| 232 | } |
| 233 | } |
| 234 | |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 235 | if (n == 0) { |
| 236 | eof = 1; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 237 | } else if (n < 0) { |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 238 | DEBUGF("Error decoding frame\n"); |
| 239 | } else { |
Magnus Holmgren | 4a53787 | 2005-07-24 15:32:28 +0000 | [diff] [blame] | 240 | while (!rb->pcmbuf_insert_split(pcm[0], pcm[1], |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 241 | n*sizeof(ogg_int32_t))) { |
Miika Pekkarinen | fbd4088 | 2005-07-11 18:47:47 +0000 | [diff] [blame] | 242 | rb->sleep(1); |
Magnus Holmgren | 4a53787 | 2005-07-24 15:32:28 +0000 | [diff] [blame] | 243 | } |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 244 | rb->set_offset(ov_raw_tell(&vf)); |
| 245 | rb->set_elapsed(ov_time_tell(&vf)); |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 246 | } |
| 247 | } |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 248 | |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 249 | if (rb->request_next_track()) { |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 250 | /* Clean things up for the next track */ |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 251 | vf.dataoffsets = NULL; |
| 252 | vf.offsets = NULL; |
| 253 | vf.serialnos = NULL; |
| 254 | vf.pcmlengths = NULL; |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 255 | ov_clear(&vf); |
Thom Johansen | 0ad1ed6 | 2005-10-10 20:19:09 +0000 | [diff] [blame] | 256 | previous_section = -1; |
Linus Nielsen Feltzing | eaf8b2d | 2005-07-05 08:43:36 +0000 | [diff] [blame] | 257 | goto next_track; |
| 258 | } |
| 259 | |
Brandon Low | 1060e44 | 2006-01-18 20:22:03 +0000 | [diff] [blame] | 260 | error = CODEC_OK; |
| 261 | exit: |
| 262 | return error; |
Daniel Stenberg | 1dd672f | 2005-06-22 19:41:30 +0000 | [diff] [blame] | 263 | } |
Linus Nielsen Feltzing | c4b7c67 | 2005-07-11 06:47:35 +0000 | [diff] [blame] | 264 | |