Merge branch 'master' into next
[paraslash.git] / oggdec_filter.c
index 0653f7dadd0d7223e27ea9e339d113420aaa7a5f..02f04b4809e66864e78e0bde29b8cd0665c6984e 100644 (file)
@@ -1,13 +1,15 @@
 /*
 /*
- * Copyright (C) 2005-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2009 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \file oggdec_filter.c Paraslash's ogg vorbis decoder. */
 
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
 /** \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"
 #include "oggdec_filter.cmdline.h"
 #include "list.h"
 #include "sched.h"
@@ -16,8 +18,6 @@
 #include "error.h"
 #include "string.h"
 
 #include "error.h"
 #include "string.h"
 
-#include <vorbis/vorbisfile.h>
-
 /** Determine byte sex. */
 #ifdef WORDS_BIGENDIAN
 #define ENDIAN 1
 /** Determine byte sex. */
 #ifdef WORDS_BIGENDIAN
 #define ENDIAN 1
@@ -125,7 +125,9 @@ static ssize_t ogg_convert(char *inbuffer, size_t len, struct filter_node *fn)
 
        if (!pod->vf) {
                int ib = 1024 * conf->initial_buffer_arg; /* initial buffer */
 
        if (!pod->vf) {
                int ib = 1024 * conf->initial_buffer_arg; /* initial buffer */
-               if (len <ib && !*fn->fc->input_error) {
+               if (*fn->fc->input_error < 0)
+                       return *fn->fc->input_error;
+               if (len < ib) {
                        PARA_DEBUG_LOG("initial input buffer %zd/%d, "
                                "waiting for more data\n", len, ib);
                        return 0;
                        PARA_DEBUG_LOG("initial input buffer %zd/%d, "
                                "waiting for more data\n", len, ib);
                        return 0;