More oggdec cleanups.
authorAndre Noll <maan@systemlinux.org>
Tue, 12 Jan 2010 06:12:58 +0000 (07:12 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 12 Jan 2010 06:12:58 +0000 (07:12 +0100)
oggdec_filter.c

index 18ca437d8494b6c0fb48bba10555d7f989819adb..7a52508ec8a7bdc0a2ad0d423f65c44d68b905c0 100644 (file)
 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);