av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
return AVERROR(EINVAL);
}
+ if (out % s->channels) {
+ av_log(avctx, AV_LOG_WARNING, "channels have differing number of samples\n");
+ }
/* get output buffer */
- s->frame.nb_samples = out / s->channels;
+ s->frame.nb_samples = (out + s->channels - 1) / s->channels;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
case CODEC_ID_SOL_DPCM:
if (avctx->codec_tag != 3) {
- uint8_t *output_samples_u8 = output_samples;
+ uint8_t *output_samples_u8 = s->frame.data[0];
while (buf < buf_end) {
uint8_t n = *buf++;