diff options
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 = { |