diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:05:13 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:05:13 +0100 |
commit | 1d0b3b20c34517b9d1ddf3ea347776304b0c4b44 (patch) | |
tree | 89f4fc640c2becc6f00ae08996754952ecf149c1 /contrib/ffmpeg/libavcodec/truespeech.c | |
parent | 09496ad3469a0ade8dbd9a351e639b78f20b7942 (diff) | |
download | xine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.gz xine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.bz2 |
Update internal FFmpeg copy.
Diffstat (limited to 'contrib/ffmpeg/libavcodec/truespeech.c')
-rw-r--r-- | contrib/ffmpeg/libavcodec/truespeech.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/ffmpeg/libavcodec/truespeech.c b/contrib/ffmpeg/libavcodec/truespeech.c index a03f2a0ce..9deac28be 100644 --- a/contrib/ffmpeg/libavcodec/truespeech.c +++ b/contrib/ffmpeg/libavcodec/truespeech.c @@ -57,7 +57,7 @@ static int truespeech_decode_init(AVCodecContext * avctx) return 0; } -static void truespeech_read_frame(TSContext *dec, uint8_t *input) +static void truespeech_read_frame(TSContext *dec, const uint8_t *input) { uint32_t t; @@ -329,19 +329,21 @@ static void truespeech_save_prevvec(TSContext *c) static int truespeech_decode_frame(AVCodecContext *avctx, void *data, int *data_size, - uint8_t *buf, int buf_size) + const uint8_t *buf, int buf_size) { TSContext *c = avctx->priv_data; - int i; + int i, j; short *samples = data; int consumed = 0; int16_t out_buf[240]; + int iterations; if (!buf_size) return 0; - while (consumed < buf_size) { + iterations = FFMIN(buf_size / 32, *data_size / 480); + for(j = 0; j < iterations; j++) { truespeech_read_frame(c, buf + consumed); consumed += 32; @@ -366,7 +368,7 @@ static int truespeech_decode_frame(AVCodecContext *avctx, *data_size = consumed * 15; - return buf_size; + return consumed; } AVCodec truespeech_decoder = { |