aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-16 18:55:04 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:02:26 +0100
commit3c7ba39d092c3318edc536b31bb3a47a0227ef4e (patch)
tree17bc06a7954daffc34ab5e2ab0bb50517bc30528
parent7c98d284ff73b662f8f4c583018fafcdde62c111 (diff)
downloadffmpeg-3c7ba39d092c3318edc536b31bb3a47a0227ef4e.tar.gz
h264: retuen the amount read in case of NAL_END_SEQUENCE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 227960427b726eaa6c83702e3d49679754cbc322) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 5a06a8a0d5..fa95d7035f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4047,15 +4047,15 @@ static int decode_frame(AVCodecContext *avctx,
MpegEncContext *s = &h->s;
AVFrame *pict = data;
int buf_index;
+ Picture *out;
+ int i, out_idx;
s->flags= avctx->flags;
s->flags2= avctx->flags2;
/* end of stream, output what is still in the buffers */
- out:
if (buf_size == 0) {
- Picture *out;
- int i, out_idx;
+ out:
s->current_picture_ptr = NULL;
@@ -4076,7 +4076,7 @@ static int decode_frame(AVCodecContext *avctx,
*pict= *(AVFrame*)out;
}
- return 0;
+ return buf_size;
}
if(h->is_avc && buf_size >= 9 && buf[0]==1 && buf[2]==0 && (buf[4]&0xFC)==0xFC && (buf[5]&0x1F) && buf[8]==0x67){
int cnt= buf[5]&0x1f;
@@ -4106,7 +4106,8 @@ not_extra:
return -1;
if (!s->current_picture_ptr && h->nal_unit_type == NAL_END_SEQUENCE) {
- buf_size = 0;
+ av_assert0(buf_index <= buf_size);
+ buf_size = buf_index;
goto out;
}