qemu/audio
Markus Armbruster 8631b6084a monitor: Separate "default monitor" and "current monitor" cleanly
Commits 376253ec..731b0364 introduced global variable cur_mon, which
points to the "default monitor" (if any), except during execution of
monitor_read() or monitor_control_read() it points to the monitor from
which we're reading instead (the "current monitor").  Monitor command
handlers run within monitor_read() or monitor_control_read().

Default monitor and current monitor are really separate things, and
squashing them together is confusing and error-prone.

For instance, usb_host_scan() can run both in "info usbhost" and
periodically via usb_host_auto_check().  It prints to cur_mon, which
is what we want in the former case: the monitor executing "info
usbhost".  But since that's the default monitor in the latter case, it
periodically spams the default monitor there.

A few places use cur_mon to log stuff to the default monitor.  If we
ever log something while cur_mon points to current monitor instead of
default monitor, the log temporarily "jumps" to another monitor.
Whether that can or cannot happen isn't always obvious.

Maybe logging to the default monitor (which may not even exist) is a
bad idea, and we should log to stderr or a logfile instead.  But
that's outside the scope of this commit.

Change cur_mon to point to the current monitor.  Create new
default_mon to point to the default monitor.  Update users of cur_mon
accordingly.

This fixes the periodical spamming of the default monitor by
usb_host_scan().  It also stops "log jumping", should that problem
exist.
2010-03-16 16:55:05 +01:00
..
alsaaudio.c audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handler 2010-02-28 18:34:21 +03:00
audio_int.h audio: remove last remnants of _t 2009-10-15 02:40:17 +04:00
audio_pt_int.c
audio_pt_int.h
audio_template.h audio: fix compilation of DEBUG_PLIVE 2009-12-03 09:41:25 -06:00
audio_win_int.c Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
audio_win_int.h Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
audio.c monitor: Separate "default monitor" and "current monitor" cleanly 2010-03-16 16:55:05 +01:00
audio.h audio: remove last remnants of _t 2009-10-15 02:40:17 +04:00
coreaudio.c audio: internal API change 2009-09-18 14:04:36 +04:00
dsound_template.h Fix NAME2/FIELD2 warnings 2009-01-22 22:09:55 +00:00
dsoundaudio.c Windows Waveform Audio driver (no ADC support yet) 2009-10-10 01:18:24 +04:00
esdaudio.c audio: internal API change 2009-09-18 14:04:36 +04:00
fmodaudio.c audio: internal API change 2009-09-18 14:04:36 +04:00
mixeng_template.h Make audio violate POSIX less 2008-12-03 22:48:44 +00:00
mixeng.c audio: fix comment 2010-03-11 18:28:44 +03:00
mixeng.h coreaudio: fix sloppy "posixification" by 1ea879e558 2009-09-18 14:04:36 +04:00
noaudio.c audio: internal API change 2009-09-18 14:04:36 +04:00
ossaudio.c Workaround for broken OSS_GETVERSION on FreeBSD, part two 2010-01-13 01:59:03 +03:00
paaudio.c qemu: allow pulseaudio to be the default 2009-10-13 18:14:50 +04:00
rate_template.h Make audio violate POSIX less 2008-12-03 22:48:44 +00:00
sdlaudio.c Revert "sdlaudio: make it suck less" 2010-01-17 00:25:29 +03:00
wavaudio.c audio: internal API change 2009-09-18 14:04:36 +04:00
wavcapture.c Remove any pretense that there can be more than one AudioState 2009-05-14 03:20:43 +04:00
winwaveaudio.c winwave: ADC support 2009-10-15 10:43:45 +04:00