[FFmpeg-cvslog] Support decoding of 8 bit True Audio samples-
Carl Eugen Hoyos
git at videolan.org
Tue May 3 01:10:27 CEST 2011
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Tue May 3 01:06:18 2011 +0200| [4cf2e30f056f092f4b04d516ee45ceb1ec7f268e] | committer: Carl Eugen Hoyos
Support decoding of 8 bit True Audio samples-
Many samples will fail because "Output buffer size is too small."
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4cf2e30f056f092f4b04d516ee45ceb1ec7f268e
---
libavcodec/tta.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 217354c..b00c54d 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -263,7 +263,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
return -1;
}
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 3: avctx->sample_fmt = AV_SAMPLE_FMT_S24; break;
case 4: avctx->sample_fmt = AV_SAMPLE_FMT_S32; break;
@@ -442,6 +442,13 @@ static int tta_decode_frame(AVCodecContext *avctx,
// convert to output buffer
switch(s->bps) {
+ case 1: {
+ uint8_t *samples = data;
+ for (p = s->decode_buffer; p < s->decode_buffer + (framelen * s->channels); p++)
+ *samples++ = *p + 0x80;
+ *data_size = samples - (uint8_t *)data;
+ break;
+ }
case 2: {
uint16_t *samples = data;
for (p = s->decode_buffer; p < s->decode_buffer + (framelen * s->channels); p++) {
More information about the ffmpeg-cvslog
mailing list