Cygwin: dsp: Fix SNDCTL_DSP_{POST,SYNC} ioctl() behaviour.
Previously, SNDCTL_DSP_POST and SNDCTL_DSP_SYNC were implemented wrongly. Due to this issue, module-oss of pulseaudio generates choppy sound when SNDCTL_DSP_POST is called. This patch fixes that. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
This commit is contained in:
parent
e95a7a7955
commit
0ab22f0af9
|
@ -133,6 +133,8 @@ class fhandler_dev_dsp::Audio_out: public Audio
|
||||||
int freq_;
|
int freq_;
|
||||||
int bits_;
|
int bits_;
|
||||||
int channels_;
|
int channels_;
|
||||||
|
|
||||||
|
friend fhandler_dev_dsp;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void CALLBACK waveIn_callback (HWAVEIN hWave, UINT msg,
|
static void CALLBACK waveIn_callback (HWAVEIN hWave, UINT msg,
|
||||||
|
@ -1429,11 +1431,16 @@ fhandler_dev_dsp::_ioctl (unsigned int cmd, void *buf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
CASE (SNDCTL_DSP_POST)
|
CASE (SNDCTL_DSP_POST)
|
||||||
|
if (audio_out_)
|
||||||
|
audio_out_->sendcurrent (); // force out last block whatever size..
|
||||||
|
return 0;
|
||||||
|
|
||||||
CASE (SNDCTL_DSP_SYNC)
|
CASE (SNDCTL_DSP_SYNC)
|
||||||
// Stop audio out device
|
if (audio_out_)
|
||||||
close_audio_out ();
|
{
|
||||||
// Stop audio in device
|
audio_out_->sendcurrent (); // force out last block whatever size..
|
||||||
close_audio_in ();
|
audio_out_->waitforallsent (); // block till finished..
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue