From 1c48415bb9f628d4f8e67e007309fb6ffe3735e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20=C3=96man?= Date: Mon, 18 Jun 2007 08:48:26 +0000 Subject: [PATCH] =?utf8?q?indentation=20patch=20by=20Andreas=20=C3=96man:?= =?utf8?q?=20[andreas=20olebyn=20nu]?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Originally committed as revision 9360 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 8b499df6b..993062482 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -7683,32 +7683,32 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){ uint8_t *ptr; int i, nalsize = 0; - if(h->is_avc) { - if(buf_index >= buf_size) break; - nalsize = 0; - for(i = 0; i < h->nal_length_size; i++) - nalsize = (nalsize << 8) | buf[buf_index++]; - if(nalsize <= 1 || (nalsize+buf_index > buf_size)){ - if(nalsize == 1){ - buf_index++; - continue; - }else{ - av_log(h->s.avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize); - break; + if(h->is_avc) { + if(buf_index >= buf_size) break; + nalsize = 0; + for(i = 0; i < h->nal_length_size; i++) + nalsize = (nalsize << 8) | buf[buf_index++]; + if(nalsize <= 1 || (nalsize+buf_index > buf_size)){ + if(nalsize == 1){ + buf_index++; + continue; + }else{ + av_log(h->s.avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize); + break; + } + } + } else { + // start code prefix search + for(; buf_index + 3 < buf_size; buf_index++){ + // This should always succeed in the first iteration. + if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1) + break; } - } - } else { - // start code prefix search - for(; buf_index + 3 < buf_size; buf_index++){ - // This should always succeed in the first iteration. - if(buf[buf_index] == 0 && buf[buf_index+1] == 0 && buf[buf_index+2] == 1) - break; - } - if(buf_index+3 >= buf_size) break; + if(buf_index+3 >= buf_size) break; - buf_index+=3; - } + buf_index+=3; + } ptr= decode_nal(h, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index); if (ptr==NULL || dst_length < 0){ -- 2.11.0