summaryrefslogtreecommitdiffstats
path: root/audio/out/push.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-11-21 18:31:32 +0100
committerwm4 <wm4@nowhere>2016-11-21 19:35:06 +0100
commitfcba41e2e4752d6391c76ef4e2c9f0c8c5734159 (patch)
treecf159b15e11c008a3399cc2b4d7421edfae5ee8a /audio/out/push.c
parentb39a7fddb556ec9b56eb1a66b5f333b884d0b4d8 (diff)
downloadmpv-fcba41e2e4752d6391c76ef4e2c9f0c8c5734159.tar.bz2
mpv-fcba41e2e4752d6391c76ef4e2c9f0c8c5734159.tar.xz
audio: fix --audio-stream-silence with ao_alsa
ao_alsa.c calls this before the common code sets ao->sstride. Other than this, I'm still not sure whether this works. Seems like no, or depends.
Diffstat (limited to 'audio/out/push.c')
-rw-r--r--audio/out/push.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/audio/out/push.c b/audio/out/push.c
index 68606386f2..555a7867da 100644
--- a/audio/out/push.c
+++ b/audio/out/push.c
@@ -453,8 +453,9 @@ int ao_play_silence(struct ao *ao, int samples)
assert(ao->api == &ao_api_push);
if (samples <= 0 || !af_fmt_is_pcm(ao->format) || !ao->driver->play)
return 0;
- char *p = talloc_size(NULL, samples * ao->sstride);
- af_fill_silence(p, samples * ao->sstride, ao->format);
+ int bytes = af_fmt_to_bytes(ao->format) * samples * ao->channels.num;
+ char *p = talloc_size(NULL, bytes);
+ af_fill_silence(p, bytes, ao->format);
void *tmp[MP_NUM_CHANNELS];
for (int n = 0; n < MP_NUM_CHANNELS; n++)
tmp[n] = p;