diff options
author | Pascal Massimino <pascal.massimino@gmail.com> | 2008-05-29 20:09:45 +0000 |
---|---|---|
committer | Pascal Massimino <pascal.massimino@gmail.com> | 2008-05-29 20:09:45 +0000 |
commit | ae899d12aea6ca2a16e65fb2771d9b0c739a0985 (patch) | |
tree | ac5a148ef12a9aaf8cec416a8bcf8d7d0d5d262f | |
parent | 369074680e765074a2725e637f6d58e2fc51749c (diff) | |
download | ffmpeg-ae899d12aea6ca2a16e65fb2771d9b0c739a0985.tar.gz |
in TRUNCATED mode, use residual fragments in ParseContext
for decoding the very last frame.
Originally committed as revision 13538 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h264.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 6f9ece512e..5be52a6c45 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -7656,6 +7656,15 @@ static int decode_frame(AVCodecContext *avctx, s->flags= avctx->flags; s->flags2= avctx->flags2; + if(s->flags&CODEC_FLAG_TRUNCATED){ + const int next= ff_h264_find_frame_end(h, buf, buf_size); + assert((buf_size > 0) || (next == END_NOT_FOUND)); + + if( ff_combine_frame(&s->parse_context, next, &buf, &buf_size) < 0 ) + return buf_size; +//printf("next:%d buf_size:%d last_index:%d\n", next, buf_size, s->parse_context.last_index); + } + /* no supplementary picture */ if (buf_size == 0) { Picture *out; @@ -7681,14 +7690,6 @@ static int decode_frame(AVCodecContext *avctx, return 0; } - if(s->flags&CODEC_FLAG_TRUNCATED){ - int next= ff_h264_find_frame_end(h, buf, buf_size); - - if( ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf, &buf_size) < 0 ) - return buf_size; -//printf("next:%d buf_size:%d last_index:%d\n", next, buf_size, s->parse_context.last_index); - } - if(h->is_avc && !h->got_avcC) { int i, cnt, nalsize; unsigned char *p = avctx->extradata; |