diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-09 13:30:03 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-19 13:26:47 -0400 |
commit | 5138ff143f2ab3ea0dd7a34e03820f15ec64451d (patch) | |
tree | 528d7426e41a951527781b66c3ef9be8fe3fe6a7 /libavcodec | |
parent | 7a206eb32f624171a35235f714d44ee9dec9abcb (diff) | |
download | ffmpeg-5138ff143f2ab3ea0dd7a34e03820f15ec64451d.tar.gz |
alac: use AVPacket fields directly in alac_decode_frame()
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alac.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 1fc4dc5cec..ac51c2f3ee 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -291,8 +291,6 @@ static void interleave_stereo_24(int32_t *buffer[MAX_CHANNELS], static int alac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { - const uint8_t *inbuffer = avpkt->data; - int input_buffer_size = avpkt->size; ALACContext *alac = avctx->priv_data; int channels; @@ -303,7 +301,7 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data, uint8_t interlacing_leftweight; int i, ch, ret; - init_get_bits(&alac->gb, inbuffer, input_buffer_size * 8); + init_get_bits(&alac->gb, avpkt->data, avpkt->size * 8); channels = get_bits(&alac->gb, 3) + 1; if (channels != avctx->channels) { @@ -457,13 +455,14 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data, break; } - if (input_buffer_size * 8 - get_bits_count(&alac->gb) > 8) - av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n", input_buffer_size * 8 - get_bits_count(&alac->gb)); + if (avpkt->size * 8 - get_bits_count(&alac->gb) > 8) + av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n", + avpkt->size * 8 - get_bits_count(&alac->gb)); *got_frame_ptr = 1; *(AVFrame *)data = alac->frame; - return input_buffer_size; + return avpkt->size; } static av_cold int alac_decode_close(AVCodecContext *avctx) |