summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-07-29 19:50:14 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-07-29 19:50:14 +0200
commit796c80dd7311f7db3c4c097c11357c0dd17200d9 (patch)
tree4064a8b97d3d9846c445faa7e5f652ca88d7db53
parent669529cffa42b4ee0eaf7d85a5f4f6024b92a9bb (diff)
streamer regression bugfix
-rw-r--r--streamer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/streamer.c b/streamer.c
index ec475c9d..2811467f 100644
--- a/streamer.c
+++ b/streamer.c
@@ -1786,11 +1786,6 @@ streamer_thread (void *ctx) {
int bytes_in_one_second = rate * (output->fmt.bps>>3) * channels;
int blocksize = bytes_in_one_second / 40;
- int samplesize = output->fmt.channels * (output->fmt.bps>>3);
- if (blocksize % samplesize) {
- blocksize -= (blocksize % samplesize);
- }
-
if (blocksize < MIN_BLOCK_SIZE) {
blocksize = MIN_BLOCK_SIZE;
}
@@ -1798,6 +1793,8 @@ streamer_thread (void *ctx) {
blocksize = MAX_BLOCK_SIZE;
}
+ blocksize &= ~3; // 4byte alignment is required
+
int alloc_time = 1000 / (bytes_in_one_second / blocksize);
int skip = 0;
@@ -1876,7 +1873,7 @@ streamer_thread (void *ctx) {
// add 1ms here to compensate the rounding error
// and another 1ms to buffer slightly faster then playing
alloc_time -= ms+2;
- if (streamer_buffering || streamer_ringbuf.remaining > STREAM_BUFFER_SIZE / 2) {
+ if (streamer_buffering || streamer_ringbuf.remaining < STREAM_BUFFER_SIZE / 2) {
alloc_time >>= 1;
}
if (alloc_time > 0) {