summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-06 13:11:22 +0200
committerwm4 <wm4@nowhere>2013-07-06 13:11:22 +0200
commit886d982aa3677370ae280745872a90d0ebb2f769 (patch)
tree50c5919a782b2cef2974725568c187dcf40d0717
parentb2b3778a48cfb5ba48546e0e840f2b62c5587c1f (diff)
downloadmpv-886d982aa3677370ae280745872a90d0ebb2f769.tar.bz2
mpv-886d982aa3677370ae280745872a90d0ebb2f769.tar.xz
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.
-rw-r--r--audio/out/ao_jack.c4
1 files 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);