summaryrefslogtreecommitdiffstats
path: root/audio/out/pull.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-09 18:18:41 +0200
committerwm4 <wm4@nowhere>2015-06-09 18:26:14 +0200
commita2b1c6d3f69a97369d582494fbc5c51db62d1613 (patch)
tree6af1e50daba5e3298b0234f88796ee534fbf7849 /audio/out/pull.c
parent3399b775b7b51ab04a271bef3cae3d43ac0308cc (diff)
downloadmpv-a2b1c6d3f69a97369d582494fbc5c51db62d1613.tar.bz2
mpv-a2b1c6d3f69a97369d582494fbc5c51db62d1613.tar.xz
audio/out/pull: correctly pad partial frames with silence
If a frame could only be partially filled with real audio data, the silence wasn't written at the correct offset. It could have happened that the remainder of the frame contained garbage. (This didn't happen in the more common case of playing dummy silence.)
Diffstat (limited to 'audio/out/pull.c')
-rw-r--r--audio/out/pull.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/pull.c b/audio/out/pull.c
index 951034dd78..c658144a2d 100644
--- a/audio/out/pull.c
+++ b/audio/out/pull.c
@@ -155,7 +155,7 @@ end:
// pad with silence (underflow/paused/eof)
for (int n = 0; n < ao->num_planes; n++)
- af_fill_silence(data[n], full_bytes - bytes, ao->format);
+ af_fill_silence((char *)data[n] + bytes, full_bytes - bytes, ao->format);
return bytes / ao->sstride;
}