Remove useless computation. After the pthread_cond_wait loop there are at least MIN(od->bufferSize, size) free bytes in the buffer. Thus MIN(od->bufferSize - od->len, size) is always equal to MIN(od->bufferSize, size).

This commit is contained in:
Emanuele Giaquinta 2008-12-17 15:50:23 +01:00 committed by Max Kellermann
parent c584d6b087
commit 25c04a97d3

View File

@ -330,8 +330,6 @@ osx_play(void *data, const char *playChunk, size_t size)
pthread_cond_wait(&od->condition, &od->mutex); pthread_cond_wait(&od->condition, &od->mutex);
} }
bytesToCopy = od->bufferSize - od->len;
bytesToCopy = bytesToCopy < size ? bytesToCopy : size;
size -= bytesToCopy; size -= bytesToCopy;
od->len += bytesToCopy; od->len += bytesToCopy;