X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mp3dec_filter.c;h=aceee9ae686666583f5b6a3bfbbc515cbc4c6328;hp=ce6cfbcb6e78eebe60764a5dc617cf5b89fd1b53;hb=35fb7de0ca7f871a6832d1041321d52af66fdf7b;hpb=40de1dd2fdbb054444d585aa70e2d50166a66e07;ds=sidebyside diff --git a/mp3dec_filter.c b/mp3dec_filter.c index ce6cfbcb..aceee9ae 100644 --- a/mp3dec_filter.c +++ b/mp3dec_filter.c @@ -1,11 +1,14 @@ /* - * Copyright (C) 2005-2008 Andre Noll + * Copyright (C) 2005-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ /** \file mp3dec_filter.c Paraslash's mp3 decoder. */ +#include +#include + #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 #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;