• Jiejun Zhang's avatar
    lavc/audiotoolboxenc: fix noise in encoded audio · 677701c6
    Jiejun Zhang authored
    This fixes #6940
    
    Although undocumented, AudioToolbox seems to require the data supplied
    by the callback (i.e. ffat_encode_callback) being unchanged until the
    next time the callback is called. In the old implementation, the
    AVBuffer backing the frame is recycled after the frame is freed, and
    somebody else (maybe the decoder) will write into the AVBuffer and
    change the data. AudioToolbox then encodes some wrong data and noise
    is produced. Retaining a frame reference solves this problem.
    Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
    677701c6
audiotoolboxenc.c 23.3 KB