mirror of https://github.com/mpv-player/mpv
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.)
This commit is contained in:
parent
3399b775b7
commit
a2b1c6d3f6
|
@ -155,7 +155,7 @@ end:
|
||||||
|
|
||||||
// pad with silence (underflow/paused/eof)
|
// pad with silence (underflow/paused/eof)
|
||||||
for (int n = 0; n < ao->num_planes; n++)
|
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;
|
return bytes / ao->sstride;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue