[Spice-devel] [spice opus support 3/6 (take 3)] Add support for the Opus codec

Christophe Fergeau cfergeau at redhat.com
Wed Nov 27 01:46:07 PST 2013


On Tue, Nov 26, 2013 at 02:30:14PM -0600, Jeremy White wrote:
> Yah.
> 
> In looking at this, though, I also notice that I failed to use K&R
> braces in a number of places.
> 
> That's disrespectful of me; I should fix it :-/.

Oh, don't really bother going over the whole patch, I only noticed it here
as the function are nearly identical.

> 
> >>@@ -1464,8 +1525,10 @@ void snd_attach_playback(SpicePlaybackInstance *sin)
> >>      red_channel_register_client_cbs(channel, &client_cbs);
> >>      red_channel_set_data(channel, playback_worker);
> >>
> >>-    if (snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_CELT_0_5_1))
> >>+    if (snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_CELT_0_5_1, SND_CODEC_ANY_FREQUENCY))
> >>          red_channel_set_cap(channel, SPICE_PLAYBACK_CAP_CELT_0_5_1);
> >>+    if (snd_codec_is_capable(SPICE_AUDIO_DATA_MODE_OPUS, SND_CODEC_ANY_FREQUENCY))
> >>+        red_channel_set_cap(channel, SPICE_PLAYBACK_CAP_OPUS);
> >
> >I think I would have delayed this bit until
> >spice_server_set_playback_rate() is called, but this works this way too.
> 
> I think you're right.  As written, we'll advertise Opus support,
> even when run with an old qemu.  I think if I shift that logic into
> the spice_server_set_xxx_rate functions, it will be cleaner.
> 
> The K&R fixes will require a respin of common/snd_codec.c.  I may
> also replace a certain true/false pair with a flag while I'm at it.

Fwiw, I can live without a respin of common/snd_codec.c, it's just the
specific instance of the {} that I'd like to see fixed, but I can even do
that before pushing.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20131127/ada7eff2/attachment.pgp>


More information about the Spice-devel mailing list