summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_jack.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_jack.c')
-rw-r--r--audio/out/ao_jack.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c
index 20dd0d4aab..f69c6c928d 100644
--- a/audio/out/ao_jack.c
+++ b/audio/out/ao_jack.c
@@ -319,19 +319,20 @@ static void audio_resume(struct ao *ao)
static int get_space(struct ao *ao)
{
struct priv *p = ao->priv;
- return mp_ring_available(p->ring);
+ return mp_ring_available(p->ring) / ao->sstride;
}
/**
* \brief write data into buffer and reset underrun flag
*/
-static int play(struct ao *ao, void *data, int len, int flags)
+static int play(struct ao *ao, void **data, int samples, int flags)
{
struct priv *p = ao->priv;
+ int len = samples * ao->sstride;
if (!(flags & AOPLAY_FINAL_CHUNK))
len -= len % p->outburst;
p->underrun = 0;
- return mp_ring_write(p->ring, data, len);
+ return mp_ring_write(p->ring, data[0], len) / ao->sstride;
}
#define OPT_BASE_STRUCT struct priv