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. */
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;
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.
*
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);