Mercurial > libavcodec.hg
comparison h264_parser.c @ 7986:38d577c3cb60 libavcodec
fix warning reported by Intel C compiler:
libavcodec/h264_parser.c(77): warning #589: transfer of control
bypasses initialization of:
variable "v" (declared at line 58)
goto found;
This new form also improves readability.
Patch by Diego 'Flameeyes' Petten? %flameeyes A gmail P com%
| author | gpoirier |
|---|---|
| date | Thu, 02 Oct 2008 19:24:26 +0000 |
| parents | 2b72f9bc4f06 |
| children | 0607ff0877ff |
comparison
equal
deleted
inserted
replaced
| 7985:5be50ba0ce24 | 7986:38d577c3cb60 |
|---|---|
| 57 }else if(state<=5){ | 57 }else if(state<=5){ |
| 58 int v= buf[i] & 0x1F; | 58 int v= buf[i] & 0x1F; |
| 59 if(v==7 || v==8 || v==9){ | 59 if(v==7 || v==8 || v==9){ |
| 60 if(pc->frame_start_found){ | 60 if(pc->frame_start_found){ |
| 61 i++; | 61 i++; |
| 62 found: | 62 goto found; |
| 63 pc->state=7; | |
| 64 pc->frame_start_found= 0; | |
| 65 return i-(state&5); | |
| 66 } | 63 } |
| 67 }else if(v==1 || v==2 || v==5){ | 64 }else if(v==1 || v==2 || v==5){ |
| 68 if(pc->frame_start_found){ | 65 if(pc->frame_start_found){ |
| 69 state+=8; | 66 state+=8; |
| 70 continue; | 67 continue; |
| 78 state= 7; | 75 state= 7; |
| 79 } | 76 } |
| 80 } | 77 } |
| 81 pc->state= state; | 78 pc->state= state; |
| 82 return END_NOT_FOUND; | 79 return END_NOT_FOUND; |
| 80 | |
| 81 found: | |
| 82 pc->state=7; | |
| 83 pc->frame_start_found= 0; | |
| 84 return i-(state&5); | |
| 83 } | 85 } |
| 84 | 86 |
| 85 static int h264_parse(AVCodecParserContext *s, | 87 static int h264_parse(AVCodecParserContext *s, |
| 86 AVCodecContext *avctx, | 88 AVCodecContext *avctx, |
| 87 const uint8_t **poutbuf, int *poutbuf_size, | 89 const uint8_t **poutbuf, int *poutbuf_size, |
