output/alsa: add full check before calling FillWithSilence()
This commit is contained in:
parent
8f6c750064
commit
549faa8a9c
|
@ -123,6 +123,8 @@ public:
|
|||
*/
|
||||
void FillWithSilence(const uint8_t *_silence,
|
||||
const size_t frame_size) noexcept {
|
||||
assert(!IsFull());
|
||||
|
||||
size_t partial_frame = tail % frame_size;
|
||||
auto *dest = GetTail() - partial_frame;
|
||||
|
||||
|
|
|
@ -746,7 +746,7 @@ AlsaOutput::DrainInternal()
|
|||
/* drain ring_buffer */
|
||||
CopyRingToPeriodBuffer();
|
||||
|
||||
if (period_buffer.WasConsumed())
|
||||
if (period_buffer.WasConsumed() && !period_buffer.IsFull())
|
||||
/* generate some silence to finish the partial
|
||||
period */
|
||||
period_buffer.FillWithSilence(silence, out_frame_size);
|
||||
|
|
Loading…
Reference in New Issue