diff options
author | Alfred E. Heggestad <aeh@db.org> | 2016-04-24 16:12:18 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2016-04-24 16:12:18 +0200 |
commit | 0179976c246f2dd18a340df21c68c90e23590b6a (patch) | |
tree | a2b3d33c06c32f48b524b14f92a7a36a3356adea /src/audio.c | |
parent | 936a29e4eb8deac34fd902cd84653f5411f6f768 (diff) |
fix some ccheck warnings
Diffstat (limited to 'src/audio.c')
-rw-r--r-- | src/audio.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/audio.c b/src/audio.c index 47b4c36..d862e89 100644 --- a/src/audio.c +++ b/src/audio.c @@ -248,11 +248,17 @@ static inline uint32_t get_srate(const struct aucodec *ac) if (!ac) return 0; - return !str_casecmp(ac->name, "G722") ? 16000 : !str_casecmp(ac->name, "MPA") ? 48000 : ac->srate; + if (!str_casecmp(ac->name, "G722")) + return 16000; + else if (!str_casecmp(ac->name, "MPA")) + return 48000; + else + return ac->srate; } + /** - * Get the DSP samplerate for an audio-codec (exception for G.722) + * Get the DSP samplerate for an audio-codec (exception for MPA) */ static inline uint32_t get_ch(const struct aucodec *ac) { @@ -346,7 +352,8 @@ static void encode_rtp_send(struct audio *a, struct autx *tx, /* The RTP clock rate used for generating the RTP timestamp is * independent of the number of channels and the encoding */ - frame_size = (tx->is_g722 ? sampc/2 : tx->is_mpa ? sampc*90/48 : sampc) / get_ch(tx->ac); + frame_size = (tx->is_g722 ? sampc/2 : + tx->is_mpa ? sampc*90/48 : sampc) / get_ch(tx->ac); tx->ts += (uint32_t)frame_size; @@ -1383,7 +1390,8 @@ static int aucodec_print(struct re_printf *pf, const struct aucodec *ac) if (!ac) return 0; - return re_hprintf(pf, "%s %uHz/%dch", ac->name, get_srate(ac), get_ch(ac)); + return re_hprintf(pf, "%s %uHz/%dch", + ac->name, get_srate(ac), get_ch(ac)); } |