[FFmpeg-cvslog] tta: use skip_bits_long()
Paul B Mahol
git at videolan.org
Sun May 6 00:28:29 CEST 2012
ffmpeg | branch: release/0.10 | Paul B Mahol <onemda at gmail.com> | Sun Feb 5 19:39:13 2012 +0000| [cf5e119d4a43f230bd79125568637499ed952397] | committer: Reinhard Tartler
tta: use skip_bits_long()
Signed-off-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>
(cherry picked from commit 9aff2d17533576f4ff52531e534f1319fb36a590)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf5e119d4a43f230bd79125568637499ed952397
---
libavcodec/tta.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index c8daff2..2fc1eb4 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -191,7 +191,6 @@ static int tta_get_unary(GetBitContext *gb)
static av_cold int tta_decode_init(AVCodecContext * avctx)
{
TTAContext *s = avctx->priv_data;
- int i;
s->avctx = avctx;
@@ -203,7 +202,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
if (show_bits_long(&s->gb, 32) == AV_RL32("TTA1"))
{
/* signature */
- skip_bits(&s->gb, 32);
+ skip_bits_long(&s->gb, 32);
s->format = get_bits(&s->gb, 16);
if (s->format > 2) {
@@ -219,7 +218,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->bps = (avctx->bits_per_coded_sample + 7) / 8;
avctx->sample_rate = get_bits_long(&s->gb, 32);
s->data_length = get_bits_long(&s->gb, 32);
- skip_bits(&s->gb, 32); // CRC32 of header
+ skip_bits_long(&s->gb, 32); // CRC32 of header
if (s->channels == 0) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
@@ -261,9 +260,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->data_length, s->frame_length, s->last_frame_length, s->total_frames);
// FIXME: seek table
- for (i = 0; i < s->total_frames; i++)
- skip_bits(&s->gb, 32);
- skip_bits(&s->gb, 32); // CRC32 of seektable
+ skip_bits_long(&s->gb, 32 * s->total_frames);
+ skip_bits_long(&s->gb, 32); // CRC32 of seektable
if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){
av_log(avctx, AV_LOG_ERROR, "frame_length too large\n");
@@ -404,7 +402,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
if (get_bits_left(&s->gb) < 32)
return -1;
- skip_bits(&s->gb, 32); // frame crc
+ skip_bits_long(&s->gb, 32); // frame crc
// convert to output buffer
if (s->bps == 2) {
More information about the ffmpeg-cvslog
mailing list