static int add_wave_in(struct ausrc_st *st) { struct dspbuf *db = &st->bufs[st->pos]; WAVEHDR *wh = &db->wh; MMRESULT res; wh->lpData = (LPSTR)db->mb->buf; wh->dwBufferLength = db->mb->size; wh->dwBytesRecorded = 0; wh->dwFlags = 0; wh->dwUser = (DWORD_PTR)db->mb; waveInPrepareHeader(st->wavein, wh, sizeof(*wh)); res = waveInAddBuffer(st->wavein, wh, sizeof(*wh)); if (res != MMSYSERR_NOERROR) { warning("winwave: add_wave_in: waveInAddBuffer fail: %08x\n", res); return ENOMEM; } INC_RPOS(st->pos); st->inuse++; return 0; }
static void add_wave_in(struct ausrc_st *st) { MMRESULT res; struct dspbuf *db = &st->bufs[st->pos]; WAVEHDR *wh = &db->wh; wh->lpData = (LPSTR)db->mb->buf; wh->dwBufferLength = db->mb->size; wh->dwBytesRecorded = 0; wh->dwFlags = 0; wh->dwUser = (DWORD_PTR) db->mb; waveInPrepareHeader(st->wavein, wh, sizeof(WAVEHDR)); res = waveInAddBuffer(st->wavein, wh, sizeof(WAVEHDR)); if (res != MMSYSERR_NOERROR) DEBUG_WARNING("add_wave_in: waveOutWrite fail: %08x\n", res); INC_RPOS(st->pos); st->inuse++; }