Fix mono resampling logic
Allow application to implement addref/decref