timeout can have negative values because player calls WaitForBuffers with sleeptime as argument. we should clamp it to positive values here.