summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2015-09-19 21:08:41 +0200
committerAlfred E. Heggestad <aeh@db.org>2015-09-19 21:09:06 +0200
commit0e1e1a7a392adb3ac31c1620f479228fd638efba (patch)
tree9cbd7e78b1d97f3cfaf69cd0c0b1c0e5d43b326d /src
parent03c7dffde07ef073cb3f032238ad1abaf9cebbbb (diff)
audio: lookup pt for telephone-event (fixes #72)
Diffstat (limited to 'src')
-rw-r--r--src/audio.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/audio.c b/src/audio.c
index d1b19fd..78adc7d 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -132,7 +132,6 @@ struct aurx {
int16_t *sampv_rs; /**< Sample buffer for resampler */
uint32_t ptime; /**< Packet time for receiving */
int pt; /**< Payload type for incoming RTP */
- int pt_tel; /**< Event payload type - receive */
};
@@ -594,9 +593,15 @@ static void stream_recv_handler(const struct rtp_header *hdr,
goto out;
/* Telephone event? */
- if (hdr->pt == rx->pt_tel) {
- handle_telev(a, mb);
- return;
+ if (hdr->pt != rx->pt) {
+ const struct sdp_format *fmt;
+
+ fmt = sdp_media_lformat(stream_sdpmedia(a->strm), hdr->pt);
+
+ if (fmt && !str_casecmp(fmt->name, "telephone-event")) {
+ handle_telev(a, mb);
+ return;
+ }
}
/* Comfort Noise (CN) as of RFC 3389 */
@@ -631,8 +636,6 @@ static int add_telev_codec(struct audio *a)
if (err)
return err;
- a->rx.pt_tel = sf->pt;
-
return err;
}
@@ -1367,10 +1370,10 @@ int audio_debug(struct re_printf *pf, const struct audio *a)
aubuf_debug, tx->aubuf,
tx->ptime);
- err |= re_hprintf(pf, " rx: %H %H ptime=%ums pt=%d pt_tel=%d\n",
+ err |= re_hprintf(pf, " rx: %H %H ptime=%ums pt=%d\n",
aucodec_print, rx->ac,
aubuf_debug, rx->aubuf,
- rx->ptime, rx->pt, rx->pt_tel);
+ rx->ptime, rx->pt);
err |= re_hprintf(pf,
" %H"