summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-04-24 16:12:18 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-04-24 16:12:18 +0200
commit0179976c246f2dd18a340df21c68c90e23590b6a (patch)
treea2b3d33c06c32f48b524b14f92a7a36a3356adea
parent936a29e4eb8deac34fd902cd84653f5411f6f768 (diff)
fix some ccheck warnings
-rw-r--r--modules/mpa/encode.c2
-rw-r--r--src/audio.c16
2 files changed, 13 insertions, 5 deletions
diff --git a/modules/mpa/encode.c b/modules/mpa/encode.c
index 6ed6493..4e35ebe 100644
--- a/modules/mpa/encode.c
+++ b/modules/mpa/encode.c
@@ -63,7 +63,7 @@ int mpa_encode_update(struct auenc_state **aesp, const struct aucodec *ac,
prm.samplerate = 32000;
prm.bitrate = 128000;
prm.layer = 2;
- prm.mode = SINGLE_CHANNEL;
+ prm.mode = SINGLE_CHANNEL;
mpa_decode_fmtp(&prm, fmtp);
result = 0;
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));
}