summaryrefslogtreecommitdiff
path: root/libavcodec/wmalosslessdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-15 14:04:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-15 14:09:35 +0200
commitae237a117acbe958bea798e32249f4c2baeca5f9 (patch)
treec45fc400e59ab03d5346a82580bfc2054b9efe0f /libavcodec/wmalosslessdec.c
parent4f5e5a05132be4946a655b991850bf81b7497893 (diff)
parent95cd815c3663603871a1f2da95846e8f72d4ea96 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: swscale: try to use mmap only if available configure: check for mprotect wmapro: use planar sample format wmalossless: output in planar sample format wmadec: use float planar sample format output shorten: use planar sample format lavc: update documentation for AVFrame.extended_data Conflicts: libavcodec/shorten.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmalosslessdec.c')
-rw-r--r--libavcodec/wmalosslessdec.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 7e09fd0689..6ec1fb4380 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -186,9 +186,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
channel_mask = AV_RL32(edata_ptr + 2);
s->bits_per_sample = AV_RL16(edata_ptr);
if (s->bits_per_sample == 16)
- avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
else if (s->bits_per_sample == 24) {
- avctx->sample_fmt = AV_SAMPLE_FMT_S32;
+ avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
av_log_missing_feature(avctx, "bit-depth higher than 16", 0);
return AVERROR_PATCHWELCOME;
} else {
@@ -984,11 +984,9 @@ static int decode_subframe(WmallDecodeCtx *s)
for (j = 0; j < subframe_len; j++) {
if (s->bits_per_sample == 16) {
- *s->samples_16[c] = (int16_t) s->channel_residues[c][j] << padding_zeroes;
- s->samples_16[c] += s->num_channels;
+ *s->samples_16[c]++ = (int16_t) s->channel_residues[c][j] << padding_zeroes;
} else {
- *s->samples_32[c] = s->channel_residues[c][j] << padding_zeroes;
- s->samples_32[c] += s->num_channels;
+ *s->samples_32[c]++ = s->channel_residues[c][j] << padding_zeroes;
}
}
}
@@ -1025,8 +1023,8 @@ static int decode_frame(WmallDecodeCtx *s)
return ret;
}
for (i = 0; i < s->num_channels; i++) {
- s->samples_16[i] = (int16_t *)s->frame.data[0] + i;
- s->samples_32[i] = (int32_t *)s->frame.data[0] + i;
+ s->samples_16[i] = (int16_t *)s->frame.extended_data[i];
+ s->samples_32[i] = (int32_t *)s->frame.extended_data[i];
}
/* get frame length */
@@ -1296,4 +1294,7 @@ AVCodec ff_wmalossless_decoder = {
.flush = flush,
.capabilities = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Lossless"),
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
+ AV_SAMPLE_FMT_S32P,
+ AV_SAMPLE_FMT_NONE },
};