Remove an unnecessary variable and move duplicate code to a common spot
Remove an unnecessary variable and move duplicate code to a common spot

aaronmjacobs/openal-soft,aaronmjacobs/openal-soft,alexxvk/openal-soft,alexxvk/openal-soft