X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=oggdec_filter.c;h=bac28cfdee77d5a9d48d343fc7f208111f437991;hp=18ca437d8494b6c0fb48bba10555d7f989819adb;hb=11ef83c4abb2ccbdf3f99a8adf98749b2b0656c2;hpb=bcde4ae4b702fdf496a3be1cf7fefbeef7f77456 diff --git a/oggdec_filter.c b/oggdec_filter.c index 18ca437d..bac28cfd 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. * @@ -132,11 +97,8 @@ static void ogg_open(struct filter_node *fn) { struct private_oggdec_data *pod = para_calloc( sizeof(struct private_oggdec_data)); - struct oggdec_filter_args_info *conf = fn->conf; fn->private_data = pod; - fn->bufsize = conf->bufsize_arg * 1024; - fn->buf = para_malloc(fn->bufsize); fn->min_iqs = 8000; } @@ -149,9 +111,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); - free(fn->buf); - fn->buf = NULL; + PARA_DEBUG_LOG("nothing to close\n"); free(fn->private_data); fn->private_data = NULL; }