Merge branch 'master' into next
[paraslash.git] / mp3dec_filter.c
index 8fa7094480285b5768c1f0cf991a559e13a5f1c7..aceee9ae686666583f5b6a3bfbbc515cbc4c6328 100644 (file)
@@ -1,11 +1,14 @@
 /*
- * 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 mp3dec_filter.c Paraslash's mp3 decoder. */
 
+#include <mad.h>
+#include <regex.h>
+
 #include "para.h"
 #include "mp3dec_filter.cmdline.h"
 #include "list.h"
@@ -13,7 +16,6 @@
 #include "ggo.h"
 #include "filter.h"
 #include "error.h"
-#include <mad.h>
 #include "string.h"
 
 /** Convert a sample value from libmad to a signed short. */
@@ -84,8 +86,8 @@ next_frame:
 out:
        if (pmd->stream.next_frame) { /* we still have some data */
                size_t off = pmd->stream.bufend - pmd->stream.next_frame;
-//             PARA_INFO_LOG("off: %zd, rate: %u, returning %zd\n", off,
-//                     fn->fc->samplerate, copy - off);
+               if (fn->loaded + 16384 <= fn->bufsize && off > 2048)
+                       goto next_frame;
                return copy - off;
        }
        return copy;
@@ -159,8 +161,6 @@ void mp3dec_filter_init(struct filter *f)
        f->close = mp3dec_close;
        f->parse_config = mp3dec_parse_config;
        f->help = (struct ggo_help) {
-               .purpose = mp3dec_filter_args_info_purpose,
-               .usage = mp3dec_filter_args_info_usage,
                .short_help = mp3dec_filter_args_info_help,
                .detailed_help = mp3dec_filter_args_info_detailed_help
        };