diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-04-08 22:50:39 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-04-08 23:21:47 +0200 |
commit | c18fdc86928e0b40bb634a8d8ca071270fcac2d2 (patch) | |
tree | 4e1745af3e953ade03cd34345aea3754105f66cc /libavcodec/shorten.c | |
parent | a4790e1890a1e4a659c24e50c2e1a9beab51a2a9 (diff) | |
download | ffmpeg-c18fdc86928e0b40bb634a8d8ca071270fcac2d2.tar.gz |
avcodec/shorten: remove useless if condition and comment, reindent
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r-- | libavcodec/shorten.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 7973c95917..9de6bd1c2d 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -445,29 +445,27 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, } /* append current packet data to bitstream buffer */ - if (1 && s->max_framesize) { //FIXME truncated - buf_size = FFMIN(buf_size, s->max_framesize - s->bitstream_size); - input_buf_size = buf_size; - - if (s->bitstream_index + s->bitstream_size + buf_size + AV_INPUT_BUFFER_PADDING_SIZE > - s->allocated_bitstream_size) { - memmove(s->bitstream, &s->bitstream[s->bitstream_index], - s->bitstream_size); - s->bitstream_index = 0; - } - if (buf) - memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], buf, - buf_size); - buf = &s->bitstream[s->bitstream_index]; - buf_size += s->bitstream_size; - s->bitstream_size = buf_size; - - /* do not decode until buffer has at least max_framesize bytes or - * the end of the file has been reached */ - if (buf_size < s->max_framesize && avpkt->data) { - *got_frame_ptr = 0; - return input_buf_size; - } + buf_size = FFMIN(buf_size, s->max_framesize - s->bitstream_size); + input_buf_size = buf_size; + + if (s->bitstream_index + s->bitstream_size + buf_size + AV_INPUT_BUFFER_PADDING_SIZE > + s->allocated_bitstream_size) { + memmove(s->bitstream, &s->bitstream[s->bitstream_index], + s->bitstream_size); + s->bitstream_index = 0; + } + if (buf) + memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], buf, + buf_size); + buf = &s->bitstream[s->bitstream_index]; + buf_size += s->bitstream_size; + s->bitstream_size = buf_size; + + /* do not decode until buffer has at least max_framesize bytes or + * the end of the file has been reached */ + if (buf_size < s->max_framesize && avpkt->data) { + *got_frame_ptr = 0; + return input_buf_size; } /* init and position bitstream reader */ if ((ret = init_get_bits8(&s->gb, buf, buf_size)) < 0) |