SolarisOutputPlugin: Use AUDIO_INITINFO for initialization
This is recommended by Solaris and NetBSD documentation.
This commit is contained in:
parent
3c240e2119
commit
1f0881eec0
@ -44,6 +44,7 @@
|
|||||||
#define I_FLUSH 0
|
#define I_FLUSH 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define AUDIO_INITINFO(v)
|
||||||
#define AUDIO_GETINFO 0
|
#define AUDIO_GETINFO 0
|
||||||
#define AUDIO_SETINFO 0
|
#define AUDIO_SETINFO 0
|
||||||
#define AUDIO_ENCODING_LINEAR 0
|
#define AUDIO_ENCODING_LINEAR 0
|
||||||
@ -94,6 +95,8 @@ SolarisOutput::Open(AudioFormat &audio_format)
|
|||||||
struct audio_info info;
|
struct audio_info info;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
AUDIO_INITINFO(&info);
|
||||||
|
|
||||||
/* support only 16 bit mono/stereo for now; nothing else has
|
/* support only 16 bit mono/stereo for now; nothing else has
|
||||||
been tested */
|
been tested */
|
||||||
audio_format.format = SampleFormat::S16;
|
audio_format.format = SampleFormat::S16;
|
||||||
@ -108,15 +111,6 @@ SolarisOutput::Open(AudioFormat &audio_format)
|
|||||||
|
|
||||||
fd.SetBlocking();
|
fd.SetBlocking();
|
||||||
|
|
||||||
/* configure the audio device */
|
|
||||||
|
|
||||||
ret = ioctl(fd.Get(), AUDIO_GETINFO, &info);
|
|
||||||
if (ret < 0) {
|
|
||||||
const int e = errno;
|
|
||||||
fd.Close();
|
|
||||||
throw MakeErrno(e, "AUDIO_GETINFO failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
info.play.sample_rate = audio_format.sample_rate;
|
info.play.sample_rate = audio_format.sample_rate;
|
||||||
info.play.channels = audio_format.channels;
|
info.play.channels = audio_format.channels;
|
||||||
info.play.precision = 16;
|
info.play.precision = 16;
|
||||||
|
Loading…
Reference in New Issue
Block a user