summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/snd_codec.c10
-rw-r--r--common/snd_codec.h5
2 files changed, 9 insertions, 6 deletions
diff --git a/common/snd_codec.c b/common/snd_codec.c
index 2b55b91..4a617f4 100644
--- a/common/snd_codec.c
+++ b/common/snd_codec.c
@@ -134,11 +134,11 @@ static int snd_codec_decode_opus(SndCodecInternal *codec, uint8_t *in_ptr, int i
/*
snd_codec_is_capable
- Returns TRUE if the current spice implementation can
- use the given codec, FALSE otherwise.
+ Returns true if the current spice implementation can
+ use the given codec, false otherwise.
mode must be a SPICE_AUDIO_DATA_MODE_XXX enum from spice/enum.h
*/
-int snd_codec_is_capable(int mode, int frequency)
+bool snd_codec_is_capable(SpiceAudioDataMode mode, int frequency)
{
#if HAVE_OPUS
if (mode == SPICE_AUDIO_DATA_MODE_OPUS &&
@@ -146,10 +146,10 @@ int snd_codec_is_capable(int mode, int frequency)
frequency == 48000 || frequency == 24000 ||
frequency == 16000 || frequency == 12000 ||
frequency == 8000) )
- return TRUE;
+ return true;
#endif
- return FALSE;
+ return false;
}
/*
diff --git a/common/snd_codec.h b/common/snd_codec.h
index aaba867..b58f758 100644
--- a/common/snd_codec.h
+++ b/common/snd_codec.h
@@ -19,6 +19,9 @@
#ifndef H_SPICE_COMMON_SND_CODEC
#define H_SPICE_COMMON_SND_CODEC
+#include <stdbool.h>
+#include <spice/enums.h>
+
#define SND_CODEC_OPUS_FRAME_SIZE 480
#define SND_CODEC_OPUS_PLAYBACK_FREQ 48000
#define SND_CODEC_OPUS_COMPRESSED_FRAME_BYTES 480
@@ -46,7 +49,7 @@ SPICE_BEGIN_DECLS
typedef struct SndCodecInternal * SndCodec;
-int snd_codec_is_capable(int mode, int frequency);
+bool snd_codec_is_capable(SpiceAudioDataMode mode, int frequency);
int snd_codec_create(SndCodec *codec, int mode, int frequency, int purpose);
void snd_codec_destroy(SndCodec *codec);