mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-05-06 12:27:32 -04:00
audio: replace remaining dolog() and AUD_log
Use warn_report/error_report and trace instead. Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
@@ -654,7 +654,7 @@ static size_t audio_mixeng_backend_write(AudioBackend *be, SWVoiceOut *sw,
|
||||
hw = sw->hw;
|
||||
|
||||
if (!hw->enabled) {
|
||||
dolog("Writing to disabled voice %s\n", SW_NAME(sw));
|
||||
warn_report("audio: Writing to disabled voice %s", SW_NAME(sw));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ static size_t audio_mixeng_backend_read(AudioBackend *be,
|
||||
hw = sw->hw;
|
||||
|
||||
if (!hw->enabled) {
|
||||
dolog("Reading from disabled voice %s\n", SW_NAME(sw));
|
||||
warn_report("audio: Reading from disabled voice %s", SW_NAME(sw));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -874,9 +874,8 @@ static void audio_capture_mix_and_clear(HWVoiceOut *hw, size_t rpos,
|
||||
sw->empty = sw->total_hw_samples_mixed == 0;
|
||||
|
||||
if (to_read - frames_in) {
|
||||
dolog("Could not mix %zu frames into a capture "
|
||||
"buffer, mixed %zu\n",
|
||||
to_read, frames_in);
|
||||
audio_bug("Could not mix %zu frames into a capture "
|
||||
"buffer, mixed %zu", to_read, frames_in);
|
||||
break;
|
||||
}
|
||||
n -= to_read;
|
||||
@@ -1561,7 +1560,7 @@ static CaptureVoiceOut *audio_mixeng_backend_add_capture(
|
||||
}
|
||||
|
||||
if (!audio_get_pdo_out(s->dev)->mixing_engine) {
|
||||
dolog("Can't capture with mixeng disabled\n");
|
||||
error_report("audio: Can't capture with mixeng disabled");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1754,8 +1753,7 @@ size_t audio_rate_peek_bytes(RateCtl *rate, struct audio_pcm_info *info)
|
||||
void audio_rate_add_bytes(RateCtl *rate, size_t bytes_used)
|
||||
{
|
||||
if (rate->peeked_frames < 0 || rate->peeked_frames > 65536) {
|
||||
AUD_log(NULL, "Resetting rate control (%" PRId64 " frames)\n",
|
||||
rate->peeked_frames);
|
||||
trace_audio_rate_reset(rate->peeked_frames);
|
||||
audio_rate_start(rate);
|
||||
}
|
||||
|
||||
|
||||
+8
-11
@@ -47,21 +47,19 @@ static void glue(audio_init_nb_voices_, TYPE)(AudioMixengBackend *s,
|
||||
if (glue(s->nb_hw_voices_, TYPE) > max_voices) {
|
||||
if (!max_voices) {
|
||||
#ifdef DAC
|
||||
dolog("Driver `%s' does not support " NAME "\n", k->name);
|
||||
warn_report("audio: Driver '%s' does not support " NAME, k->name);
|
||||
#endif
|
||||
} else {
|
||||
dolog("Driver `%s' does not support %d " NAME " voices, max %d\n",
|
||||
k->name,
|
||||
glue(s->nb_hw_voices_, TYPE),
|
||||
max_voices);
|
||||
warn_report("audio: Driver '%s' does not support %d " NAME " voices, max %d",
|
||||
k->name, glue(s->nb_hw_voices_, TYPE), max_voices);
|
||||
}
|
||||
glue(s->nb_hw_voices_, TYPE) = max_voices;
|
||||
}
|
||||
|
||||
if (glue(s->nb_hw_voices_, TYPE) < min_voices) {
|
||||
dolog("Bogus number of " NAME " voices %d, setting to %d\n",
|
||||
glue(s->nb_hw_voices_, TYPE),
|
||||
min_voices);
|
||||
warn_report("audio: Bogus number of " NAME " voices %d, setting to %d",
|
||||
glue(s->nb_hw_voices_, TYPE),
|
||||
min_voices);
|
||||
}
|
||||
|
||||
if (!voice_size && max_voices) {
|
||||
@@ -443,7 +441,7 @@ static SW *glue(audio_pcm_create_voice_pair_, TYPE)(
|
||||
|
||||
hw = glue(audio_pcm_hw_add_, TYPE)(s, &hw_as);
|
||||
if (!hw) {
|
||||
dolog("Could not create a backend for voice `%s'\n", sw_name);
|
||||
error_report("audio: Could not create a backend for voice '%s'", sw_name);
|
||||
goto err1;
|
||||
}
|
||||
|
||||
@@ -537,8 +535,7 @@ static SW *glue(audio_mixeng_backend_open_, TYPE) (
|
||||
HW *hw = sw->hw;
|
||||
|
||||
if (!hw) {
|
||||
dolog("Internal logic error: voice `%s' has no backend\n",
|
||||
SW_NAME(sw));
|
||||
audio_bug("Internal logic error: voice '%s' has no backend", SW_NAME(sw));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ audio_sw_write(const char *name, size_t size, size_t written, size_t total_mixed
|
||||
audio_get_free(const char *name, size_t live, size_t dead, uint32_t frontend_frames) "%s: get_free live %zu dead %zu frontend frames %u"
|
||||
audio_out_disable(void) "Disabling voice"
|
||||
audio_out_played(size_t played) "played=%zu"
|
||||
audio_rate_reset(int64_t frames) "Resetting rate control (%" PRId64 " frames)"
|
||||
|
||||
# audio_template.h
|
||||
audio_open_out(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d"
|
||||
|
||||
Reference in New Issue
Block a user