From 31dc734bf5255a493f036ec0073d8e7954d21742 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 3 May 2013 17:53:30 +0200 Subject: Add asserts where we'll need to do resampling --- server/snd_worker.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/snd_worker.c b/server/snd_worker.c index 3efb8351..51ffbb54 100644 --- a/server/snd_worker.c +++ b/server/snd_worker.c @@ -1296,6 +1296,7 @@ static uint32_t snd_select_best_mode(RedChannelClient *rcc) /* return 0 on success */ static int snd_create_encoder(PlaybackChannel *playback_channel) { + SpicePlaybackState *st = SPICE_CONTAINEROF(playback_channel->base.worker, SpicePlaybackState, worker); SndChannel *channel = (SndChannel *)playback_channel; CELTMode *celt_mode = NULL; CELTEncoder *celt_encoder = NULL; @@ -1308,6 +1309,7 @@ static int snd_create_encoder(PlaybackChannel *playback_channel) if (mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1) { channel->frame_size = CELT_FRAME_SIZE; + spice_assert (SPICE_INTERFACE_PLAYBACK_FREQ == st->sample_rate); if (!(celt_mode = celt051_mode_create(SPICE_INTERFACE_PLAYBACK_FREQ, SPICE_INTERFACE_PLAYBACK_CHAN, channel->frame_size, &celt_error))) { @@ -1324,7 +1326,7 @@ static int snd_create_encoder(PlaybackChannel *playback_channel) } else if (mode == SPICE_AUDIO_DATA_MODE_OPUS) { #ifdef HAVE_OPUS channel->frame_size = OPUS_FRAME_SIZE; - //assert (SPICE_INTERFACE_PLAYBACK_OPUS_FREQ == st->sample_rate); + spice_assert (SPICE_INTERFACE_PLAYBACK_OPUS_FREQ == st->sample_rate); if (!(opus_encoder = opus_encoder_create(SPICE_INTERFACE_PLAYBACK_OPUS_FREQ, SPICE_INTERFACE_PLAYBACK_CHAN, OPUS_APPLICATION_RESTRICTED_LOWDELAY, -- cgit v1.2.3