mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-13 21:26:33 +02:00
Support decoding of 24 bit True Audio samples-
Many samples will fail because "Output buffer size is too small."
This commit is contained in:
parent
4cf2e30f05
commit
7d70d1937a
@ -265,7 +265,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
|
|||||||
else switch(s->bps) {
|
else switch(s->bps) {
|
||||||
case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8; break;
|
case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8; break;
|
||||||
case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16; break;
|
case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16; break;
|
||||||
// case 3: avctx->sample_fmt = AV_SAMPLE_FMT_S24; break;
|
case 3: avctx->bits_per_coded_sample = 24;
|
||||||
case 4: avctx->sample_fmt = AV_SAMPLE_FMT_S32; break;
|
case 4: avctx->sample_fmt = AV_SAMPLE_FMT_S32; break;
|
||||||
default:
|
default:
|
||||||
av_log_ask_for_sample(s->avctx,
|
av_log_ask_for_sample(s->avctx,
|
||||||
@ -459,6 +459,13 @@ static int tta_decode_frame(AVCodecContext *avctx,
|
|||||||
*data_size = (uint8_t *)samples - (uint8_t *)data;
|
*data_size = (uint8_t *)samples - (uint8_t *)data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 3: {
|
||||||
|
int32_t *samples = data;
|
||||||
|
for (p = s->decode_buffer; p < s->decode_buffer + (framelen * s->channels); p++)
|
||||||
|
*samples++ = AV_RN32(p) << 8;
|
||||||
|
*data_size = (uint8_t *)samples - (uint8_t *)data;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Error, only 16bit samples supported!\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Error, only 16bit samples supported!\n");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user