Try to set AVFrame.reference to correct values.