diff options
Diffstat (limited to 'apps/codecs/demac')
-rw-r--r-- | apps/codecs/demac/libdemac/Makefile | 2 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/decoder.c | 2 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/parser.c | 14 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/parser.h | 7 | ||||
-rw-r--r-- | apps/codecs/demac/libdemac/predictor.c | 2 |
5 files changed, 19 insertions, 8 deletions
diff --git a/apps/codecs/demac/libdemac/Makefile b/apps/codecs/demac/libdemac/Makefile index 7fc784dd5f..6ef55d7fb9 100644 --- a/apps/codecs/demac/libdemac/Makefile +++ b/apps/codecs/demac/libdemac/Makefile @@ -4,7 +4,7 @@ # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ # \/ \/ \/ \/ \/ -# $Id:$ +# $Id$ # INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ diff --git a/apps/codecs/demac/libdemac/decoder.c b/apps/codecs/demac/libdemac/decoder.c index 22b6e8d325..ba8c393a67 100644 --- a/apps/codecs/demac/libdemac/decoder.c +++ b/apps/codecs/demac/libdemac/decoder.c @@ -2,7 +2,7 @@ libdemac - A Monkey's Audio decoder -$Id:$ +$Id$ Copyright (C) Dave Chapman 2007 diff --git a/apps/codecs/demac/libdemac/parser.c b/apps/codecs/demac/libdemac/parser.c index 4e907308b6..7e0fd8f250 100644 --- a/apps/codecs/demac/libdemac/parser.c +++ b/apps/codecs/demac/libdemac/parser.c @@ -92,6 +92,10 @@ int ape_parseheaderbuf(unsigned char* buf, struct ape_ctx_t* ape_ctx) ape_ctx->channels = get_uint16(header + 18); ape_ctx->samplerate = get_uint32(header + 20); + ape_ctx->seektablefilepos = ape_ctx->junklength + + ape_ctx->descriptorlength + + ape_ctx->headerlength; + ape_ctx->firstframe = ape_ctx->junklength + ape_ctx->descriptorlength + ape_ctx->headerlength + ape_ctx->seektablelength + ape_ctx->wavheaderlength; @@ -133,15 +137,19 @@ int ape_parseheaderbuf(unsigned char* buf, struct ape_ctx_t* ape_ctx) else ape_ctx->blocksperframe = 9216; - ape_ctx->firstframe = ape_ctx->junklength + ape_ctx->headerlength + - ape_ctx->seektablelength + ape_ctx->wavheaderlength; + ape_ctx->seektablefilepos = ape_ctx->junklength + ape_ctx->headerlength + + ape_ctx->wavheaderlength; + + ape_ctx->firstframe = ape_ctx->junklength + ape_ctx->headerlength + + ape_ctx->wavheaderlength + ape_ctx->seektablelength; } ape_ctx->totalsamples = ape_ctx->finalframeblocks; if (ape_ctx->totalframes > 1) ape_ctx->totalsamples += ape_ctx->blocksperframe * (ape_ctx->totalframes-1); - /* TODO: Parse and store seektable */ + ape_ctx->numseekpoints = MAX(ape_ctx->maxseekpoints, + ape_ctx->seektablelength / sizeof(int32_t)); return 0; } diff --git a/apps/codecs/demac/libdemac/parser.h b/apps/codecs/demac/libdemac/parser.h index edf4222fd5..0e35425315 100644 --- a/apps/codecs/demac/libdemac/parser.h +++ b/apps/codecs/demac/libdemac/parser.h @@ -2,7 +2,7 @@ libdemac - A Monkey's Audio decoder -$Id:$ +$Id$ Copyright (C) Dave Chapman 2007 @@ -119,7 +119,10 @@ struct ape_ctx_t uint32_t samplerate; /* Seektable */ - uint32_t* seektable; + uint32_t* seektable; /* Seektable buffer */ + uint32_t maxseekpoints; /* Max seekpoints we can store (size of seektable buffer) */ + uint32_t numseekpoints; /* Number of seekpoints */ + int seektablefilepos; /* Location in .ape file of seektable */ /* Decoder state */ uint32_t CRC; diff --git a/apps/codecs/demac/libdemac/predictor.c b/apps/codecs/demac/libdemac/predictor.c index ef72fedfbd..9531786fd1 100644 --- a/apps/codecs/demac/libdemac/predictor.c +++ b/apps/codecs/demac/libdemac/predictor.c @@ -2,7 +2,7 @@ libdemac - A Monkey's Audio decoder -$Id:$ +$Id$ Copyright (C) Dave Chapman 2007 |