X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=oggdec_filter.c;h=3de62cbd7d494dd39b84b42006a5a43797550c91;hb=e81e1c251f7793473cd6bc220f9a3476e4cf3dc0;hp=6a97d6c6191420a99af25327d517fcf6bc58ece1;hpb=305ea292b101b906e738d7bf756d4921497198d6;p=paraslash.git diff --git a/oggdec_filter.c b/oggdec_filter.c index 6a97d6c6..3de62cbd 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -8,12 +8,14 @@ #include #include +#include #include "para.h" #include "oggdec_filter.cmdline.h" #include "list.h" #include "sched.h" #include "ggo.h" +#include "buffer_tree.h" #include "filter.h" #include "error.h" #include "string.h" @@ -136,7 +138,7 @@ static ssize_t ogg_convert(char *inbuffer, size_t len, struct filter_node *fn) NULL, /* no initial buffer */ 0, /* no initial bytes */ ovc); /* the ov_open_callbacks */ - if (ret == OV_ENOTVORBIS) { + if (ret == OV_ENOTVORBIS || ret == OV_EBADHEADER) { /* this might be due to the input buffer being too small */ int ib = 1024 * conf->initial_buffer_arg; /* initial buffer */ if (len < ib) { @@ -146,14 +148,13 @@ static ssize_t ogg_convert(char *inbuffer, size_t len, struct filter_node *fn) pod->vf = NULL; return 0; } - return -E_OGGDEC_NOTVORBIS; + return ret == OV_ENOTVORBIS? + -E_OGGDEC_NOTVORBIS : -E_OGGDEC_BADHEADER; } if (ret == OV_EREAD) return -E_OGGDEC_READ; if (ret == OV_EVERSION) return -E_OGGDEC_VERSION; - if (ret == OV_EBADHEADER) - return -E_OGGDEC_BADHEADER; if (ret < 0) return -E_OGGDEC_FAULT; fn->fc->channels = ov_info(pod->vf, 0)->channels;