Shouldn't this be return 1 + gain/db_range (gain should be negative as per the doxy).

Purely cosmetic, but I'd remove comments about Android in this file - it could be used wider once done (IIRC pulse requires something similar).

Other than that, the changes look fine to me.