Mercurial > libavcodec.hg
comparison mpegvideo_parser.c @ 10685:60ca4112b5f4 libavcodec
Merge init & declaration of buf_end.
From ffmbc0.3
| author | michael |
|---|---|
| date | Mon, 14 Dec 2009 11:57:33 +0000 |
| parents | 48ecbc11c8dc |
| children | 67b3d3174b41 |
comparison
equal
deleted
inserted
replaced
| 10684:7e316791ac7b | 10685:60ca4112b5f4 |
|---|---|
| 26 static void mpegvideo_extract_headers(AVCodecParserContext *s, | 26 static void mpegvideo_extract_headers(AVCodecParserContext *s, |
| 27 AVCodecContext *avctx, | 27 AVCodecContext *avctx, |
| 28 const uint8_t *buf, int buf_size) | 28 const uint8_t *buf, int buf_size) |
| 29 { | 29 { |
| 30 ParseContext1 *pc = s->priv_data; | 30 ParseContext1 *pc = s->priv_data; |
| 31 const uint8_t *buf_end; | 31 const uint8_t *buf_end = buf + buf_size; |
| 32 uint32_t start_code; | 32 uint32_t start_code; |
| 33 int frame_rate_index, ext_type, bytes_left; | 33 int frame_rate_index, ext_type, bytes_left; |
| 34 int frame_rate_ext_n, frame_rate_ext_d; | 34 int frame_rate_ext_n, frame_rate_ext_d; |
| 35 int picture_structure, top_field_first, repeat_first_field, progressive_frame; | 35 int picture_structure, top_field_first, repeat_first_field, progressive_frame; |
| 36 int horiz_size_ext, vert_size_ext, bit_rate_ext; | 36 int horiz_size_ext, vert_size_ext, bit_rate_ext; |
| 37 int did_set_size=0; | 37 int did_set_size=0; |
| 38 //FIXME replace the crap with get_bits() | 38 //FIXME replace the crap with get_bits() |
| 39 s->repeat_pict = 0; | 39 s->repeat_pict = 0; |
| 40 buf_end = buf + buf_size; | 40 |
| 41 while (buf < buf_end) { | 41 while (buf < buf_end) { |
| 42 start_code= -1; | 42 start_code= -1; |
| 43 buf= ff_find_start_code(buf, buf_end, &start_code); | 43 buf= ff_find_start_code(buf, buf_end, &start_code); |
| 44 bytes_left = buf_end - buf; | 44 bytes_left = buf_end - buf; |
| 45 switch(start_code) { | 45 switch(start_code) { |
