summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-01-21 08:39:14 +0000
committerBenny Prijono <bennylp@teluu.com>2010-01-21 08:39:14 +0000
commit29f2c32efa33d5126e53ee1afba31f967517cf1e (patch)
treeb9c8f7090db18d85e2bb3f1fa75a7269397f29b3
parent9a47b10d958ece028b24f2c547bb1891e004cb3a (diff)
Related to #969: make maximum PLC generated frames configurable (PJMEDIA_MAX_PLC_DURATION_MSEC)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3067 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/include/pjmedia/config.h17
-rw-r--r--pjmedia/src/pjmedia/stream.c2
2 files changed, 18 insertions, 1 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h
index 8fa302ad..948598b0 100644
--- a/pjmedia/include/pjmedia/config.h
+++ b/pjmedia/include/pjmedia/config.h
@@ -217,6 +217,23 @@
/**
+ * Limit the number of calls by stream to the PLC to generate synthetic
+ * frames to this duration. If packets are still lost after this maximum
+ * duration, silence will be generated by the stream instead. Since the
+ * PLC normally should have its own limit on the maximum duration of
+ * synthetic frames to be generated (for PJMEDIA's PLC, the limit is
+ * PJMEDIA_WSOLA_MAX_EXPAND_MSEC), we can set this value to a large number
+ * to give additional flexibility should the PLC wants to do something
+ * clever with the lost frames.
+ *
+ * Default: 240 ms
+ */
+#ifndef PJMEDIA_MAX_PLC_DURATION_MSEC
+# define PJMEDIA_MAX_PLC_DURATION_MSEC 240
+#endif
+
+
+/**
* Specify number of sound buffers. Larger number is better for sound
* stability and to accommodate sound devices that are unable to send frames
* in timely manner, however it would probably cause more audio delay (and
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c
index 9e85054b..6054f9a9 100644
--- a/pjmedia/src/pjmedia/stream.c
+++ b/pjmedia/src/pjmedia/stream.c
@@ -48,7 +48,7 @@
* synthetic frames, so we need to set this to a reasonably large value
* just as precaution
*/
-#define MAX_PLC_MSEC 240
+#define MAX_PLC_MSEC PJMEDIA_MAX_PLC_DURATION_MSEC
/**
* Media channel.