Commit b439a28f authored by Thomas Guillem's avatar Thomas Guillem

auhal: warn about underrun

parent 0373782e
......@@ -111,6 +111,7 @@ struct aout_sys_t
/* circular buffer to swap the audio data */
TPCircularBuffer circular_buffer;
atomic_uint i_underrun_size;
/* AUHAL specific */
AudioComponent au_component;
......@@ -977,7 +978,10 @@ CopyOutput(audio_output_t *p_aout, uint8_t *p_output, size_t i_requested)
/* Pad with 0 */
if (i_requested > i_tocopy)
{
atomic_fetch_add(&p_sys->i_underrun_size, i_requested - i_tocopy);
memset(&p_output[i_tocopy], 0, i_requested - i_tocopy);
}
}
else
memset(p_output, 0, i_requested);
......@@ -1104,6 +1108,10 @@ Play(audio_output_t * p_aout, block_t * p_block)
msg_Warn(p_aout, "dropped buffer");
}
unsigned i_underrun_size = atomic_exchange(&p_sys->i_underrun_size, 0);
if (i_underrun_size > 0)
msg_Warn(p_aout, "underrun of %u bytes", i_underrun_size);
block_Release(p_block);
}
......@@ -2179,6 +2187,7 @@ static int Open(vlc_object_t *obj)
p_sys->b_selected_dev_is_default = false;
memset(&p_sys->sfmt_revert, 0, sizeof(p_sys->sfmt_revert));
p_sys->i_stream_id = 0;
atomic_init(&p_sys->i_underrun_size, 0);
atomic_init(&p_sys->b_paused, false);
p_aout->sys = p_sys;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment