shithub: opus-tools

Download patch

ref: 51caf7735187890eebdd21d62986ffa49acf9c40
parent: c70bafc8090be92a9c144bd3158b3dc91dd069cb
author: Ralph Giles <[email protected]>
date: Tue Oct 2 12:53:52 EDT 2012

Make the payload type a constant.

This lets us use the same value in the sniff and send functions.

--- a/src/opusrtp.c
+++ b/src/opusrtp.c
@@ -60,6 +60,8 @@
 #endif
 #include <ogg/ogg.h>
 
+#define OPUS_PAYLOAD_TYPE 113
+
 /* state struct for passing around our handles */
 typedef struct {
   ogg_stream_state *stream;
@@ -492,7 +494,7 @@
   }
 
   rtp.version = 0;
-  rtp.type = 113;
+  rtp.type = OPUS_PAYLOAD_TYPE;
   rtp.pad = 0;
   rtp.ext = 0;
   rtp.cc = 0;
@@ -670,7 +672,7 @@
   }
   params->seq = rtp.seq;
 
-  if (rtp.type != 109) {
+  if (rtp.type != OPUS_PAYLOAD_TYPE) {
     fprintf(stderr, "skipping non-opus packet\n");
     return;
   }