+ Con_Printf ("ResampleSfx: sound quality too high for resampling (%uHz, %u channel(s))\n",
+ in_format->speed, in_format->channels);
+ return 0;
+ }
+
+ // We work 1 sec at a time to make sure we don't accumulate any
+ // significant error when adding "fracstep" over several seconds, and
+ // also to be able to handle very long sounds.
+ while (total_out < outcount)
+ {
+ size_t tmpcount, interpolation_limit, i, j;
+ unsigned int srcsample;
+
+ samplefrac = 0;
+
+ // If more than 1 sec of sound remains to be converted
+ if (outcount - total_out > shm->format.speed)