Revision 39deb1e4

b/audio/audio.c
1096 1096
/*
1097 1097
 * Timer
1098 1098
 */
1099
static void audio_timer (void *opaque)
1100
{
1101
    AudioState *s = opaque;
1102

  
1103
    audio_run ("timer");
1104
    qemu_mod_timer (s->ts, qemu_get_clock (vm_clock) + conf.period.ticks);
1105
}
1106

  
1107

  
1108 1099
static int audio_is_timer_needed (void)
1109 1100
{
1110 1101
    HWVoiceIn *hwi = NULL;
......
1119 1110
    return 0;
1120 1111
}
1121 1112

  
1122
static void audio_reset_timer (void)
1113
static void audio_reset_timer (AudioState *s)
1123 1114
{
1124
    AudioState *s = &glob_audio_state;
1125

  
1126 1115
    if (audio_is_timer_needed ()) {
1127 1116
        qemu_mod_timer (s->ts, qemu_get_clock (vm_clock) + 1);
1128 1117
    }
......
1131 1120
    }
1132 1121
}
1133 1122

  
1123
static void audio_timer (void *opaque)
1124
{
1125
    audio_run ("timer");
1126
    audio_reset_timer (opaque);
1127
}
1128

  
1134 1129
/*
1135 1130
 * Public API
1136 1131
 */
......
1195 1190
                hw->enabled = 1;
1196 1191
                if (s->vm_running) {
1197 1192
                    hw->pcm_ops->ctl_out (hw, VOICE_ENABLE, conf.try_poll_out);
1198
                    audio_reset_timer ();
1193
                    audio_reset_timer (s);
1199 1194
                }
1200 1195
            }
1201 1196
        }
......
1240 1235
                hw->enabled = 1;
1241 1236
                if (s->vm_running) {
1242 1237
                    hw->pcm_ops->ctl_in (hw, VOICE_ENABLE, conf.try_poll_in);
1238
                    audio_reset_timer (s);
1243 1239
                }
1244 1240
            }
1245 1241
            sw->total_hw_samples_acquired = hw->total_samples_captured;
......
1761 1757
    while ((hwi = audio_pcm_hw_find_any_enabled_in (hwi))) {
1762 1758
        hwi->pcm_ops->ctl_in (hwi, op, conf.try_poll_in);
1763 1759
    }
1764
    audio_reset_timer ();
1760
    audio_reset_timer (s);
1765 1761
}
1766 1762

  
1767 1763
static void audio_atexit (void)

Also available in: Unified diff