diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2013-05-03 17:53:30 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2013-05-03 17:53:30 +0200 |
commit | 31dc734bf5255a493f036ec0073d8e7954d21742 (patch) | |
tree | b9c9c183994c2453da3521dc14618283bd00e095 | |
parent | b355b470b5fc08cca9a53c34a36a133ec51e35ba (diff) |
Add asserts where we'll need to do resamplingopus
-rw-r--r-- | server/snd_worker.c | 4 |
1 files changed, 3 insertions, 1 deletions
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, |