Mercurial > libavcodec.hg
comparison mpeg4audio.c @ 11587:d80d54dd267d libavcodec
Use get_bits_left() in the sync extension check.
author | alexc |
---|---|
date | Thu, 08 Apr 2010 06:04:37 +0000 |
parents | 2dc5036a8d18 |
children | 480a999ce2c4 |
comparison
equal
deleted
inserted
replaced
11586:2dc5036a8d18 | 11587:d80d54dd267d |
---|---|
113 if (parse_config_ALS(&gb, c)) | 113 if (parse_config_ALS(&gb, c)) |
114 return -1; | 114 return -1; |
115 } | 115 } |
116 | 116 |
117 if (c->ext_object_type != AOT_SBR) { | 117 if (c->ext_object_type != AOT_SBR) { |
118 int bits_left = buf_size*8 - get_bits_count(&gb); | 118 while (get_bits_left(&gb) > 15) { |
119 for (; bits_left > 15; bits_left--) { | |
120 if (show_bits(&gb, 11) == 0x2b7) { // sync extension | 119 if (show_bits(&gb, 11) == 0x2b7) { // sync extension |
121 get_bits(&gb, 11); | 120 get_bits(&gb, 11); |
122 c->ext_object_type = get_object_type(&gb); | 121 c->ext_object_type = get_object_type(&gb); |
123 if (c->ext_object_type == AOT_SBR && (c->sbr = get_bits1(&gb)) == 1) | 122 if (c->ext_object_type == AOT_SBR && (c->sbr = get_bits1(&gb)) == 1) |
124 c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_index); | 123 c->ext_sample_rate = get_sample_rate(&gb, &c->ext_sampling_index); |