Module: sems
Branch: master
Commit: 50b6ace1b5a6038d15d34071ba10930ce540662c
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=50b6ace1b5a6038d15d34071ba10930ce540662c

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Wed Mar  7 10:45:25 2012 +0100

g722/l16: include payloads only if the system sample rate is high enough.

---

 core/plug-in/g722/g722.c |    2 ++
 core/plug-in/l16/l16.c   |   10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/core/plug-in/g722/g722.c b/core/plug-in/g722/g722.c
index 7ce521d..de08f87 100644
--- a/core/plug-in/g722/g722.c
+++ b/core/plug-in/g722/g722.c
@@ -51,7 +51,9 @@ BEGIN_EXPORTS("g722", AMCI_NO_MODULEINIT, 
AMCI_NO_MODULEDESTROY)
   END_CODECS
   
   BEGIN_PAYLOADS
+#if SYSTEM_SAMPLECLOCK_RATE >= 16000
     PAYLOAD(9, "g722", 16000, 8000, 1, CODEC_G722_NB, AMCI_PT_AUDIO_FRAME)
+#endif
   END_PAYLOADS
   
   BEGIN_FILE_FORMATS
diff --git a/core/plug-in/l16/l16.c b/core/plug-in/l16/l16.c
index c8a3daa..1c778c8 100644
--- a/core/plug-in/l16/l16.c
+++ b/core/plug-in/l16/l16.c
@@ -59,11 +59,15 @@ BEGIN_EXPORTS( "l16" , AMCI_NO_MODULEINIT, 
AMCI_NO_MODULEDESTROY )
            AMCI_NO_CODEC_PLC, AMCI_NO_CODECCREATE, AMCI_NO_CODECDESTROY,
            L16_bytes2samples, L16_samples2bytes )
   END_CODECS
-    
+
   BEGIN_PAYLOADS
-       PAYLOAD( -1, "L16",  8000,  8000, 1, CODEC_L16, AMCI_PT_AUDIO_LINEAR )
-       PAYLOAD( -1, "L16", 16000, 16000, 1, CODEC_L16, AMCI_PT_AUDIO_LINEAR )
+#if SYSTEM_SAMPLECLOCK_RATE >= 32000
        PAYLOAD( -1, "L16", 32000, 32000, 1, CODEC_L16, AMCI_PT_AUDIO_LINEAR )
+#endif
+#if SYSTEM_SAMPLECLOCK_RATE >= 16000
+       PAYLOAD( -1, "L16", 16000, 16000, 1, CODEC_L16, AMCI_PT_AUDIO_LINEAR )
+#endif
+       PAYLOAD( -1, "L16",  8000,  8000, 1, CODEC_L16, AMCI_PT_AUDIO_LINEAR )
   END_PAYLOADS
 
   BEGIN_FILE_FORMATS

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to