X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mp3dec.c;h=1818d4c06a91532cbeae556d0201616fd89fc981;hp=af9de5484a0f9f150a153500fef42fd6a2920f9e;hb=1fe76952bf4244b93808da5e8fc45e92d8b37c58;hpb=0d33a2dbe45523cda6b2f2c7bca4992068558d77 diff --git a/mp3dec.c b/mp3dec.c index af9de548..1818d4c0 100644 --- a/mp3dec.c +++ b/mp3dec.c @@ -19,8 +19,8 @@ /** \file mp3dec.c paraslash's mp3 decoder */ #include "para.h" - #include "list.h" +#include "sched.h" #include "filter.h" #include "error.h" #include @@ -49,7 +49,6 @@ struct private_mp3dec_data { }; /* TODO: Convert all input if possible */ -#define FRAME_HEADER_SIZE 4 static ssize_t mp3dec(char *inbuffer, size_t len, struct filter_node *fn) { int i, ret; @@ -62,13 +61,10 @@ static ssize_t mp3dec(char *inbuffer, size_t len, struct filter_node *fn) pmd->stream.error = 0; next_frame: ret = mad_header_decode(&pmd->frame.header, &pmd->stream); - if (ret < 0) { - if (!MAD_RECOVERABLE(pmd->stream.error)) - goto out; - return FRAME_HEADER_SIZE; - } - fn->fci->samplerate = pmd->frame.header.samplerate; - fn->fci->channels = MAD_NCHANNELS(&pmd->frame.header); + if (ret < 0) + goto out; + fn->fc->samplerate = pmd->frame.header.samplerate; + fn->fc->channels = MAD_NCHANNELS(&pmd->frame.header); ret = mad_frame_decode(&pmd->frame, &pmd->stream); if (ret) { if (MAD_RECOVERABLE(pmd->stream.error) || pmd->stream.error == MAD_ERROR_BUFLEN) @@ -98,8 +94,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_DEBUG_LOG("converted %zd, rate: %u, returning %zd\n", len - off, - fn->fci->samplerate, copy - off); +// PARA_INFO_LOG("off: %zd, rate: %u, returning %zd\n", off, +// fn->fc->samplerate, copy - off); return copy - off; } return copy;