[vlc-commits] coreaudio: don't print underrun warning before first play
Thomas Guillem
git at videolan.org
Tue Jul 16 12:09:23 CEST 2019
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul 15 17:01:21 2019 +0200| [bad7a26b7c50db895066e81823e493a108c5ef2a] | committer: Thomas Guillem
coreaudio: don't print underrun warning before first play
It's perfectly OK to send 0s before the first buffer is played.
(cherry picked from commit a34bf45cd6f4b212b79e71b80c056cb392eaf7f5)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=bad7a26b7c50db895066e81823e493a108c5ef2a
---
modules/audio_output/coreaudio_common.c | 8 +++++++-
modules/audio_output/coreaudio_common.h | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/audio_output/coreaudio_common.c b/modules/audio_output/coreaudio_common.c
index 22a519a3b8..37f5652170 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -271,6 +271,8 @@ ca_Flush(audio_output_t *p_aout, bool wait)
p_sys->i_render_host_time = 0;
p_sys->i_render_frames = 0;
lock_unlock(p_sys);
+
+ p_sys->b_played = false;
}
void
@@ -352,7 +354,9 @@ ca_Play(audio_output_t * p_aout, block_t * p_block)
lock_unlock(p_sys);
- if (i_underrun_size > 0)
+ if (!p_sys->b_played)
+ p_sys->b_played = true;
+ else if (i_underrun_size > 0)
msg_Warn(p_aout, "underrun of %zu bytes", i_underrun_size);
}
@@ -400,6 +404,7 @@ ca_Initialize(audio_output_t *p_aout, const audio_sample_format_t *fmt,
}
ca_ClearOutBuffers(p_aout);
+ p_sys->b_played = false;
return VLC_SUCCESS;
}
@@ -424,6 +429,7 @@ ca_SetAliveState(audio_output_t *p_aout, bool alive)
if (!alive && p_sys->b_do_flush)
{
ca_ClearOutBuffers(p_aout);
+ p_sys->b_played = false;
p_sys->b_do_flush = false;
b_sem_post = true;
}
diff --git a/modules/audio_output/coreaudio_common.h b/modules/audio_output/coreaudio_common.h
index eaf21e7621..c9c6873a37 100644
--- a/modules/audio_output/coreaudio_common.h
+++ b/modules/audio_output/coreaudio_common.h
@@ -55,6 +55,7 @@ struct aout_sys_common
size_t i_out_max_size;
size_t i_out_size;
+ bool b_played;
block_t *p_out_chain;
block_t **pp_out_last;
uint64_t i_render_host_time;
More information about the vlc-commits
mailing list