Yet another thing not mentioned in the spec.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -572,9 +572,15 @@ static int decode_spectrum_and_dequant_ac(AACDecContext *s, float coef[1024], · 571 unmodified lines | |||
| 572 | int gb_count; | 572 | int gb_count; |
| 573 | GetBitContext gb2; | 573 | GetBitContext gb2; |
| 574 | 574 | ||
| 575 | ff_aac_ac_init(&ac, gb); | ||
| 576 | c = ff_aac_ac_map_process(state, reset, N); | 575 | c = ff_aac_ac_map_process(state, reset, N); |
| 577 | 576 | ||
| 577 | if (!len) { | ||
| 578 | ff_aac_ac_finish(state, 0, N); | ||
| 579 | return 0; | ||
| 580 | } | ||
| 581 | |||
| 582 | ff_aac_ac_init(&ac, gb); | ||
| 583 | |||
| 578 | /* Backup reader for rolling back by 14 bits at the end */ | 584 | /* Backup reader for rolling back by 14 bits at the end */ |
| 579 | gb2 = *gb; | 585 | gb2 = *gb; |
| 580 | gb_count = get_bits_count(&gb2); | 586 | gb_count = get_bits_count(&gb2); |