Skip to content

Commit

Permalink
coreaudio: change drop/paused handling
Browse files Browse the repository at this point in the history
Don't set *is_silence to true in case of underrun, if some data was
written.
  • Loading branch information
tguillem authored and jbkempf committed Dec 18, 2022
1 parent dec5d4b commit bc8627e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions modules/audio_output/coreaudio_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,14 @@ ca_Render(audio_output_t *p_aout, uint64_t host_time,

lock_lock(p_sys);


if (p_sys->b_paused)
goto drop;
{
if (is_silence != NULL)
*is_silence = true;
memset(data, 0, bytes);
lock_unlock(p_sys);
return;
}

if (!p_sys->started)
{
Expand Down Expand Up @@ -206,7 +211,11 @@ ca_Render(audio_output_t *p_aout, uint64_t host_time,
{
vlc_frame_t *f = p_sys->p_out_chain;
if (f == NULL)
goto drop;
{
memset(data, 0, bytes);
lock_unlock(p_sys);
return;
}

size_t tocopy = f->i_buffer > bytes ? bytes : f->i_buffer;

Expand Down Expand Up @@ -244,14 +253,6 @@ ca_Render(audio_output_t *p_aout, uint64_t host_time,
}

lock_unlock(p_sys);

return;

drop:
memset(data, 0, bytes);
if (is_silence != NULL)
*is_silence = true;
lock_unlock(p_sys);
}

void
Expand Down

0 comments on commit bc8627e

Please sign in to comment.