]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'maint'
authorAndre Noll <maan@systemlinux.org>
Tue, 6 Oct 2009 17:31:41 +0000 (19:31 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 6 Oct 2009 17:31:41 +0000 (19:31 +0200)
1  2 
oggdec_filter.c

diff --combined oggdec_filter.c
index 6a97d6c6191420a99af25327d517fcf6bc58ece1,7155a54f6c9a172dc72905ca6eb9ed07588ebd8c..c158df7e4df7777f1f92468c3ef0f3a333756237
@@@ -6,10 -6,8 +6,10 @@@
  
  /** \file oggdec_filter.c Paraslash's ogg vorbis decoder. */
  
 -#include "para.h"
 +#include <regex.h>
 +#include <vorbis/vorbisfile.h>
  
 +#include "para.h"
  #include "oggdec_filter.cmdline.h"
  #include "list.h"
  #include "sched.h"
@@@ -18,6 -16,8 +18,6 @@@
  #include "error.h"
  #include "string.h"
  
 -#include <vorbis/vorbisfile.h>
 -
  /** Determine byte sex. */
  #ifdef WORDS_BIGENDIAN
  #define ENDIAN 1
@@@ -136,7 -136,7 +136,7 @@@ static ssize_t ogg_convert(char *inbuff
                        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) {
                                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;