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;
- av_log_missing_feature(avctx, "bit-depth higher than 16", 0);
+ avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
+ av_log_missing_feature(avctx, "Bit-depth higher than 16", 0);
return AVERROR_PATCHWELCOME;
} else {
av_log(avctx, AV_LOG_ERROR, "Unknown bit-depth: %d\n",
s->do_arith_coding = get_bits1(&s->gb);
if (s->do_arith_coding) {
- av_log_missing_feature(s->avctx, "arithmetic coding", 1);
+ av_log_missing_feature(s->avctx, "Arithmetic coding", 1);
return AVERROR_PATCHWELCOME;
}
s->do_ac_filter = get_bits1(&s->gb);
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;
}
}
}
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 */
.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 },
};