summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames McDonnell <jmcdonnell@blackberry.com>2019-11-25 12:00:33 -0500
committerJames McDonnell <jmcdonnell@blackberry.com>2019-12-02 15:13:14 -0500
commitfa66653d99052f6fce74824ab12e0148922e27bc (patch)
tree33edc9b2b5b5063e245464900f3c534e27c81312
parentd986420f3f35d096014ca67f6c40fc3c757091f7 (diff)
Make the code compatible with future versions of QNX libasound
Some changes are being made to improve the consistency of the API. Change-Id: Idb4b8ba5d73a5242c25d306dcc7c77e3654ac3b6 Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
-rw-r--r--src/plugins/qnx-audio/audio/qnxaudioinput.cpp4
-rw-r--r--src/plugins/qnx-audio/audio/qnxaudiooutput.cpp8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp
index b16328892..70b83390c 100644
--- a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp
+++ b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp
@@ -339,7 +339,11 @@ bool QnxAudioInput::open()
void QnxAudioInput::close()
{
if (m_pcmHandle)
+#if SND_PCM_VERSION < SND_PROTOCOL_VERSION('P',3,0,2)
snd_pcm_plugin_flush(m_pcmHandle, SND_PCM_CHANNEL_CAPTURE);
+#else
+ snd_pcm_plugin_drop(m_pcmHandle, SND_PCM_CHANNEL_CAPTURE);
+#endif
if (m_pcmNotifier) {
delete m_pcmNotifier;
diff --git a/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp b/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp
index c4c09f543..34ea23604 100644
--- a/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp
+++ b/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp
@@ -123,7 +123,11 @@ void QnxAudioOutput::stop()
void QnxAudioOutput::reset()
{
if (m_pcmHandle)
+#if SND_PCM_VERSION < SND_PROTOCOL_VERSION('P',3,0,2)
snd_pcm_playback_drain(m_pcmHandle);
+#else
+ snd_pcm_channel_drain(m_pcmHandle, SND_PCM_CHANNEL_PLAYBACK);
+#endif
stop();
}
@@ -360,7 +364,11 @@ void QnxAudioOutput::close()
destroyPcmNotifiers();
if (m_pcmHandle) {
+#if SND_PCM_VERSION < SND_PROTOCOL_VERSION('P',3,0,2)
snd_pcm_plugin_flush(m_pcmHandle, SND_PCM_CHANNEL_PLAYBACK);
+#else
+ snd_pcm_plugin_drop(m_pcmHandle, SND_PCM_CHANNEL_PLAYBACK);
+#endif
snd_pcm_close(m_pcmHandle);
m_pcmHandle = 0;
}