From: Andre Noll Date: Tue, 12 Jan 2010 06:12:58 +0000 (+0100) Subject: More oggdec cleanups. X-Git-Tag: v0.4.2~137 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=5c0c60e0efe860962c2d9132f4aef3d9e43b25bc;p=paraslash.git More oggdec cleanups. --- diff --git a/oggdec_filter.c b/oggdec_filter.c index 18ca437d..7a52508e 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -31,10 +31,6 @@ struct private_oggdec_data { /** Describes an ogg vorbis file. */ OggVorbis_File *vf; - /** The input buffer. */ - char *inbuf; - /** The length of \a inbuf. */ - size_t inbuf_len; /** The number of bytes consumed from the input buffer. */ size_t converted; /** When to start producing output. */ @@ -45,28 +41,7 @@ struct private_oggdec_data { unsigned int samplerate; }; -static size_t cb_read_nobtr(void *buf, size_t size, size_t nmemb, void *datasource) -{ - struct filter_node *fn = datasource; - struct private_oggdec_data *pod = fn->private_data; - size_t ret, have = pod->inbuf_len - pod->converted; - char *p = pod->inbuf + pod->converted; - -// PARA_DEBUG_LOG("pod = %p\n", pod); -// PARA_DEBUG_LOG("vorbis requests %d bytes, have %d\n", size * nmemb, have); - if (pod->inbuf_len < size) { - if (*fn->fc->input_error) - return 0; - errno = EAGAIN; - return (size_t)-1; - } - ret = PARA_MIN(nmemb, have / size) * size; - memcpy(buf, p, ret); - pod->converted += ret; - return ret; -} - -static size_t cb_read_btr(void *buf, size_t size, size_t nmemb, void *datasource) +static size_t cb_read(void *buf, size_t size, size_t nmemb, void *datasource) { struct filter_node *fn = datasource; struct private_oggdec_data *pod = fn->private_data; @@ -90,16 +65,6 @@ static size_t cb_read_btr(void *buf, size_t size, size_t nmemb, void *datasource return tmp; } -static size_t cb_read(void *buf, size_t size, size_t nmemb, void *datasource) -{ - struct filter_node *fn = datasource; - - if (fn->btrn) - return cb_read_btr(buf, size, nmemb, datasource); - else - return cb_read_nobtr(buf, size, nmemb, datasource); -} - /* * Custom data seeking function. * @@ -149,7 +114,7 @@ static void ogg_close(struct filter_node *fn) free(pod->vf); pod->vf = NULL; } else - PARA_DEBUG_LOG("nothing to close in fc %p, pod = %p\n", pod->vf, pod); + PARA_DEBUG_LOG("nothing to close\n"); free(fn->buf); fn->buf = NULL; free(fn->private_data);