[FFmpeg-devel] [PATCH 2/2] lavc/aac_ac3_parser: Cosmetics
Jun Zhao
mypopydev at gmail.com
Mon Jun 29 16:23:11 EEST 2020
From: Jun Zhao <barryjzhao at tencent.com>
Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
libavcodec/aac_ac3_parser.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index b26790d..23c60f6 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -37,37 +37,36 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1,
int got_frame = 0;
get_next:
- i=END_NOT_FOUND;
- if(s->remaining_size <= buf_size){
- if(s->remaining_size && !s->need_next_header){
- i= s->remaining_size;
+ i = END_NOT_FOUND;
+ if (s->remaining_size <= buf_size) {
+ if (s->remaining_size && !s->need_next_header) {
+ i = s->remaining_size;
s->remaining_size = 0;
- }else{ //we need a header first
- len=0;
- for(i=s->remaining_size; i<buf_size; i++){
+ } else { //we need a header first
+ len = 0;
+ for (i=s->remaining_size; i<buf_size; i++) {
s->state = (s->state<<8) + buf[i];
- if((len=s->sync(s->state, s, &s->need_next_header, &new_frame_start)))
+ if ((len=s->sync(s->state, s, &s->need_next_header, &new_frame_start)))
break;
}
- if(len<=0){
- i=END_NOT_FOUND;
- }else{
+ if (len <= 0) {
+ i = END_NOT_FOUND;
+ } else {
got_frame = 1;
- s->state=0;
+ s->state = 0;
i-= s->header_size -1;
s->remaining_size = len;
- if(!new_frame_start || pc->index+i<=0){
+ if (!new_frame_start || pc->index+i <= 0) {
s->remaining_size += i;
goto get_next;
- }
- else if (i < 0) {
+ } else if (i < 0) {
s->remaining_size += i;
}
}
}
}
- if(ff_combine_frame(pc, i, &buf, &buf_size)<0){
+ if (ff_combine_frame(pc, i, &buf, &buf_size) < 0) {
s->remaining_size -= FFMIN(s->remaining_size, buf_size);
*poutbuf = NULL;
*poutbuf_size = 0;
--
2.7.4
More information about the ffmpeg-devel
mailing list