output/alsa: improve silence generator test in DrainInternal()
There cannot be partial frames in the buffer, so we don't need GetPeriodPosition(); it's enough to check whether head has been moved in this period.
This commit is contained in:
@@ -746,8 +746,7 @@ AlsaOutput::DrainInternal()
|
||||
/* drain ring_buffer */
|
||||
CopyRingToPeriodBuffer();
|
||||
|
||||
auto period_position = period_buffer.GetPeriodPosition(out_frame_size);
|
||||
if (period_position > 0)
|
||||
if (period_buffer.WasConsumed())
|
||||
/* generate some silence to finish the partial
|
||||
period */
|
||||
period_buffer.FillWithSilence(silence, out_frame_size);
|
||||
|
||||
Reference in New Issue
Block a user