diff options
Diffstat (limited to 'apps/codecs/demac/libdemac/decoder.c')
-rw-r--r-- | apps/codecs/demac/libdemac/decoder.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/codecs/demac/libdemac/decoder.c b/apps/codecs/demac/libdemac/decoder.c index 2200faf187..0763c11037 100644 --- a/apps/codecs/demac/libdemac/decoder.c +++ b/apps/codecs/demac/libdemac/decoder.c | |||
@@ -89,14 +89,17 @@ int ICODE_ATTR_DEMAC decode_chunk(struct ape_ctx_t* ape_ctx, | |||
89 | #else | 89 | #else |
90 | #define SCALE(x) (x) | 90 | #define SCALE(x) (x) |
91 | #endif | 91 | #endif |
92 | |||
93 | if ((ape_ctx->channels==1) || ((ape_ctx->frameflags | ||
94 | & (APE_FRAMECODE_PSEUDO_STEREO|APE_FRAMECODE_STEREO_SILENCE)) | ||
95 | == APE_FRAMECODE_PSEUDO_STEREO)) { | ||
92 | 96 | ||
93 | if ((ape_ctx->channels==1) || (ape_ctx->frameflags & APE_FRAMECODE_PSEUDO_STEREO)) { | 97 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, |
94 | if (ape_ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) { | 98 | decoded0, NULL, count); |
95 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, decoded1, count); | 99 | |
100 | if (ape_ctx->frameflags & APE_FRAMECODE_MONO_SILENCE) { | ||
96 | /* We are pure silence, so we're done. */ | 101 | /* We are pure silence, so we're done. */ |
97 | return 0; | 102 | return 0; |
98 | } else { | ||
99 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, NULL, count); | ||
100 | } | 103 | } |
101 | 104 | ||
102 | switch (ape_ctx->compressiontype) | 105 | switch (ape_ctx->compressiontype) |
@@ -142,12 +145,14 @@ int ICODE_ATTR_DEMAC decode_chunk(struct ape_ctx_t* ape_ctx, | |||
142 | } | 145 | } |
143 | #endif | 146 | #endif |
144 | } else { /* Stereo */ | 147 | } else { /* Stereo */ |
145 | if (ape_ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) { | 148 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, |
149 | decoded0, decoded1, count); | ||
150 | |||
151 | if ((ape_ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) | ||
152 | == APE_FRAMECODE_STEREO_SILENCE) { | ||
146 | /* We are pure silence, so we're done. */ | 153 | /* We are pure silence, so we're done. */ |
147 | return 0; | 154 | return 0; |
148 | } | 155 | } |
149 | |||
150 | entropy_decode(ape_ctx, inbuffer, firstbyte, bytesconsumed, decoded0, decoded1, count); | ||
151 | 156 | ||
152 | /* Apply filters - compression type 1000 doesn't have any */ | 157 | /* Apply filters - compression type 1000 doesn't have any */ |
153 | switch (ape_ctx->compressiontype) | 158 | switch (ape_ctx->compressiontype) |