On Fri, Apr 07, 2017 at 10:24:01AM -0500, Jonathon Jongsma wrote: > It can be useful for debug to know what the codec of the playback and > record channels are, so add a debug-level print statement indicating > this. > > Resolves: rhbz#1436251 > --- > server/sound.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/server/sound.c b/server/sound.c > index 6a6d965..eb0220f 100644 > --- a/server/sound.c > +++ b/server/sound.c > @@ -314,6 +314,18 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s > return TRUE; > } > > +static > +const char* spice_audio_data_mode_to_string(gint mode) > +{ > + static const char *str[] = { > + [ SPICE_AUDIO_DATA_MODE_INVALID ] = "invalid", > + [ SPICE_AUDIO_DATA_MODE_RAW ] = "raw", > + [ SPICE_AUDIO_DATA_MODE_CELT_0_5_1 ] = "celt", > + [ SPICE_AUDIO_DATA_MODE_OPUS ] = "opus", > + }; > + return (mode >= 0 && mode < G_N_ELEMENTS(str)) ? str[mode] : "unknown audio codec"; I'd use a regular if {} here. Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx> Christophe
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel