From: Andre Noll Date: Tue, 6 Oct 2009 17:31:17 +0000 (+0200) Subject: ogg: retry ov_open_callbacks() also on OV_EBADHEADER errors. X-Git-Tag: v0.4.0~3^2~7 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=d85fbc51d17cef18be68efe9a606021c92e47597;ds=sidebyside ogg: retry ov_open_callbacks() also on OV_EBADHEADER errors. --- diff --git a/oggdec_filter.c b/oggdec_filter.c index bdfafedf..7155a54f 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -136,7 +136,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 +146,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;