diff options
Diffstat (limited to 'audio/out/push.c')
-rw-r--r-- | audio/out/push.c | 5 |
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; |