AVFrame.sample_rate is set in ff_get_buffer, but aacdec calls ff_get_buffer before the samplerate is known. So it needs to be set again before returning the frame.