rem: src->curbufdelta = 0;
context: mixSDL_SourceGetNextSample (mixSDL_Source *src, sint32* psamp, bool left){	/* fake the data if requested */	if (mixer_driverflags & MIX_DRIVER_FAKE_DATA)		return mixSDL_SourceGetFakeSample (src, psamp, left);	while (src->nextqueued)	{		mixSDL_Buffer *buf = src->nextqueued;		uint8* data;		double samp;				if (!buf->data || buf->size < mixer_sampsize)		{			/* buffer invalid, go next */			buf->state = MIX_BUF_PROCESSED;			src->curbufofs = 0;			src->curbufdelta = 0;			src->prevqueued = src->nextqueued;			src->nextqueued = src->nextqueued->next;			src->cprocessed++;			continue;		}		if (mixer_freq == buf->orgfreq)		{			data = buf->data + (uint32)src->curbufofs;			samp = mixSDL_GetSampleInt (data, mixer_chansize);			src->curbufofs += mixer_chansize;		}		else if (mixer_freq > buf->orgfreq)		{			if (mixer_quality == MIX_QUALITY_DEFAULT)				samp = mixSDL_GetResampledInt_linear (src, left);			else if (mixer_quality == MIX_QUALITY_HIGH)				samp = mixSDL_GetResampledInt_cubic (src, left);			else				samp = mixSDL_GetResampledInt_nearest (src, left);		}		else		{			/* because currently linear and cubic resamplers do not work			   for downsampling */			samp = mixSDL_GetResampledInt_nearest (src, left);		}				samp *= src->gain;		if (mixer_chansize == 2)		{			/* check S16 clipping */			if (samp > MIX_S16_MAX)				*psamp = SINT16_MAX;			else if (samp < MIX_S16_MIN)				*psamp = SINT16_MIN;			else				*psamp = (sint32)samp;		}		else		{			/* check S8 clipping */			if (samp > MIX_S8_MAX)				*psamp = SINT8_MAX;			else if (samp < MIX_S8_MIN)				*psamp = SINT8_MIN;			else				*psamp = (sint32)samp;		}		if (src->curbufofs >= buf->size)		{				/* buffer exhausted, go next */			buf->state = MIX_BUF_PROCESSED;			src->curbufofs = 0;			src->curbufdelta = 0;			src->prevqueued = src->nextqueued;			src->nextqueued = src->nextqueued->next;			src->cprocessed++;		}		else		{			buf->state = MIX_BUF_PLAYING;		}				return true;	}		/* no more playable buffers */	if (src->state >= MIX_PLAYING)		mixSDL_SourceDeactivate (src);	src->state = MIX_STOPPED;	return false;}