summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVictor Toso <vtosodec@redhat.com>2014-10-23 13:47:25 +0200
committerVictor Toso <vtosodec@redhat.com>2014-10-23 14:54:48 +0200
commitc22fbffbc79f92e1d2976f6f19bf275cf81b5ec2 (patch)
tree8d067b67f440c5cef1c9a8c6122731464bd54158 /common
parentfbdd4e41c00e8f5a2d7397d69f4d4fac53d311c8 (diff)
common: Fix -Wunused-variable
Fix a few warnings from unused variables when compiling spice-common without OPUS or celt051.
Diffstat (limited to 'common')
-rw-r--r--common/snd_codec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/snd_codec.c b/common/snd_codec.c
index e4809b4..9738311 100644
--- a/common/snd_codec.c
+++ b/common/snd_codec.c
@@ -310,7 +310,9 @@ void snd_codec_destroy(SndCodec *codec)
*/
int snd_codec_frame_size(SndCodec codec)
{
+#if defined(HAVE_CELT051) || defined(HAVE_OPUS)
SndCodecInternal *c = (SndCodecInternal *) codec;
+#endif
#if HAVE_CELT051
if (c && c->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1)
return SND_CODEC_CELT_FRAME_SIZE;
@@ -342,7 +344,9 @@ int snd_codec_frame_size(SndCodec codec)
*/
int snd_codec_encode(SndCodec codec, uint8_t *in_ptr, int in_size, uint8_t *out_ptr, int *out_size)
{
+#if defined(HAVE_CELT051) || defined(HAVE_OPUS)
SndCodecInternal *c = (SndCodecInternal *) codec;
+#endif
#if HAVE_CELT051
if (c && c->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1) {
/* The output buffer size in celt determines the compression,
@@ -379,7 +383,9 @@ int snd_codec_encode(SndCodec codec, uint8_t *in_ptr, int in_size, uint8_t *out_
*/
int snd_codec_decode(SndCodec codec, uint8_t *in_ptr, int in_size, uint8_t *out_ptr, int *out_size)
{
+#if defined(HAVE_CELT051) || defined(HAVE_OPUS)
SndCodecInternal *c = (SndCodecInternal *) codec;
+#endif
#if HAVE_CELT051
if (c && c->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1)
return snd_codec_decode_celt051(c, in_ptr, in_size, out_ptr, out_size);