diff options
Diffstat (limited to 'audio/out/ao_pcm.c')
-rw-r--r-- | audio/out/ao_pcm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/audio/out/ao_pcm.c b/audio/out/ao_pcm.c index f7d793700d..1d88fc6665 100644 --- a/audio/out/ao_pcm.c +++ b/audio/out/ao_pcm.c @@ -118,6 +118,9 @@ static int init(struct ao *ao) if (!priv->outputfilename) priv->outputfilename = talloc_strdup(priv, priv->waveheader ? "audiodump.wav" : "audiodump.pcm"); + + ao->format = af_fmt_from_planar(ao->format); + if (priv->waveheader) { // WAV files must have one of the following formats @@ -193,13 +196,14 @@ static int get_space(struct ao *ao) return 65536; } -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; + int len = samples * ao->sstride; - fwrite(data, len, 1, priv->fp); + fwrite(data[0], len, 1, priv->fp); priv->data_length += len; - return len; + return len / ao->sstride; } #define OPT_BASE_STRUCT struct priv |