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_dsound.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_dsound.c')
-rw-r--r-- | audio/out/ao_dsound.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/audio/out/ao_dsound.c b/audio/out/ao_dsound.c index 464947c0dc..f828a210dc 100644 --- a/audio/out/ao_dsound.c +++ b/audio/out/ao_dsound.c @@ -388,7 +388,7 @@ static int init(struct ao *ao) WAVEFORMATEXTENSIBLE wformat; DSBUFFERDESC dsbpridesc; DSBUFFERDESC dsbdesc; - int format = ao->format; + int format = af_fmt_from_planar(ao->format); int rate = ao->samplerate; if (AF_FORMAT_IS_AC3(format)) @@ -596,7 +596,7 @@ static int get_space(struct ao *ao) int space = check_free_buffer_size(ao); if (space < p->min_free_space) return 0; - return space - p->min_free_space; + return (space - p->min_free_space) / ao->sstride; } /** @@ -606,9 +606,10 @@ static int get_space(struct ao *ao) \param flags currently unused \return number of played bytes */ -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; int space = check_free_buffer_size(ao); if (space < len) @@ -616,7 +617,7 @@ static int play(struct ao *ao, void *data, int len, int flags) if (!(flags & AOPLAY_FINAL_CHUNK)) len = (len / p->outburst) * p->outburst; - return write_buffer(ao, data, len); + return write_buffer(ao, data[0], len) / ao->sstride; } /** |