diff options
author | wm4 <wm4@nowhere> | 2013-11-12 23:42:04 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-12 23:42:04 +0100 |
commit | e4bbb1d348dafbb32722f413648006a7bd9d0897 (patch) | |
tree | 7165ed9f86a77b751187600d0a9de8b35416f380 /audio/out/ao_portaudio.c | |
parent | e4f2fcc0ecd31322df65141edf0ddbff9c075f5d (diff) | |
parent | 22b3f522cacfbdba76d311c86efd6091512eb089 (diff) | |
download | mpv-e4bbb1d348dafbb32722f413648006a7bd9d0897.tar.bz2 mpv-e4bbb1d348dafbb32722f413648006a7bd9d0897.tar.xz |
Merge branch 'planar_audio'
Conflicts:
audio/out/ao_lavc.c
Diffstat (limited to 'audio/out/ao_portaudio.c')
-rw-r--r-- | audio/out/ao_portaudio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/audio/out/ao_portaudio.c b/audio/out/ao_portaudio.c index 8b235f8806..9c0d7804f8 100644 --- a/audio/out/ao_portaudio.c +++ b/audio/out/ao_portaudio.c @@ -242,6 +242,8 @@ static int init(struct ao *ao) = Pa_GetDeviceInfo(pa_device)->defaultHighOutputLatency, }; + ao->format = af_fmt_from_planar(ao->format); + const struct format_map *fmt = format_maps; while (fmt->pa_format) { if (fmt->mp_format == ao->format) { @@ -278,13 +280,13 @@ error_exit: return -1; } -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 *priv = ao->priv; pthread_mutex_lock(&priv->ring_mutex); - int write_len = mp_ring_write(priv->ring, data, len); + int write_len = mp_ring_write(priv->ring, data[0], samples * ao->sstride); if (flags & AOPLAY_FINAL_CHUNK) priv->play_remaining = true; @@ -293,7 +295,7 @@ static int play(struct ao *ao, void *data, int len, int flags) if (Pa_IsStreamStopped(priv->stream) == 1) check_pa_ret(Pa_StartStream(priv->stream)); - return write_len; + return write_len / ao->sstride; } static int get_space(struct ao *ao) @@ -306,7 +308,7 @@ static int get_space(struct ao *ao) pthread_mutex_unlock(&priv->ring_mutex); - return free; + return free / ao->sstride; } static float get_delay(struct ao *ao) |