From 886d982aa3677370ae280745872a90d0ebb2f769 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 6 Jul 2013 13:11:22 +0200 Subject: ao_jack: increase buffer size, always round up buffer size This should help with github issue #128, which reported stuttering distorted sound with 6 channel audio, but not with 2 channels. --- audio/out/ao_jack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c index c677f4555d..9c38dcde97 100644 --- a/audio/out/ao_jack.c +++ b/audio/out/ao_jack.c @@ -43,7 +43,7 @@ //! size of one chunk, if this is too small MPlayer will start to "stutter" //! after a short time of playback -#define CHUNK_SIZE (16 * 1024) +#define CHUNK_SIZE (24 * 1024) //! number of "virtual" chunks the buffer consists of #define NUM_CHUNKS 8 @@ -281,7 +281,7 @@ static int init(struct ao *ao, char *params) ao->format = AF_FORMAT_FLOAT_NE; int unitsize = ao->channels.num * sizeof(float); - p->outburst = CHUNK_SIZE / unitsize * unitsize; + p->outburst = (CHUNK_SIZE + unitsize - 1) / unitsize * unitsize; p->ring = mp_ring_new(p, NUM_CHUNKS * p->outburst); free(matching_ports); free(port_name); -- cgit v1.2.3