[Spice-commits] common/snd_codec.c

Victor Toso de Carvalho victortoso at kemper.freedesktop.org
Thu Oct 23 09:16:14 PDT 2014


 common/snd_codec.c |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit c22fbffbc79f92e1d2976f6f19bf275cf81b5ec2
Author: Victor Toso <vtosodec at redhat.com>
Date:   Thu Oct 23 13:47:25 2014 +0200

    common: Fix -Wunused-variable
    
    Fix a few warnings from unused variables when compiling spice-common
    without OPUS or celt051.

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);


More information about the Spice-commits mailing list