• Markus Armbruster's avatar
    monitor: Separate "default monitor" and "current monitor" cleanly · 8631b608
    Markus Armbruster authored
    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.
    8631b608
Name
Last commit
Last update
..
alsaaudio.c Loading commit data...
audio.c Loading commit data...
audio.h Loading commit data...
audio_int.h Loading commit data...
audio_pt_int.c Loading commit data...
audio_pt_int.h Loading commit data...
audio_template.h Loading commit data...
audio_win_int.c Loading commit data...
audio_win_int.h Loading commit data...
coreaudio.c Loading commit data...
dsound_template.h Loading commit data...
dsoundaudio.c Loading commit data...
esdaudio.c Loading commit data...
fmodaudio.c Loading commit data...
mixeng.c Loading commit data...
mixeng.h Loading commit data...
mixeng_template.h Loading commit data...
noaudio.c Loading commit data...
ossaudio.c Loading commit data...
paaudio.c Loading commit data...
rate_template.h Loading commit data...
sdlaudio.c Loading commit data...
wavaudio.c Loading commit data...
wavcapture.c Loading commit data...
winwaveaudio.c Loading commit data...