shithub: opus-tools

Download patch

ref: f6655e0e060052314720a163e8074448676f076e
parent: 0a543c4c27a94cb4c19d4052c4071909b3717039
author: Martin Meszaros <meszaros@hft-leipzig.de>
date: Fri Oct 27 17:52:12 EDT 2017

opusrtp: Add support for RTP extension headers

Properly calculate the header size when extension headers are used.

Signed-off-by: Mark Harris <mark.hsj@gmail.com>

--- a/src/opusrtp.c
+++ b/src/opusrtp.c
@@ -436,6 +436,12 @@
   rtp->ext = (packet[0] >> 4) & 1;
   rtp->cc = packet[0] & 7;
   rtp->header_size = 12 + 4 * rtp->cc;
+  if (rtp->ext == 1) {
+    uint16_t ext_length;
+    rtp->header_size += 4;
+    ext_length = rbe16(packet + rtp->header_size - 2);
+    rtp->header_size += ext_length * 4;
+  }
   rtp->payload_size = size - rtp->header_size;
 
   rtp->mark = (packet[1] >> 7) & 1;