[dahdi-commits] dahdi/tools.git branch "master" updated.

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Tue Sep 16 19:15:21 CDT 2014


branch "master" has been updated
       via  094bb2c1e80ec09e8964b5819ad62be3840efad7 (commit)
      from  9aee76a3a557fb9fed06c4df73dfebe4837a3abd (commit)

Summary of changes:
 tonezone.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 094bb2c1e80ec09e8964b5819ad62be3840efad7
Author: Russ Meyerriecks <rmeyerriecks at digium.com>
Date:   Tue Aug 19 15:22:30 2014 -0500

    tonezone: Fix regression in Australian tone patch
    
    Initialize db to 1.0 instead of doing it in a few, but not all, logic contexts.
    
    Reported-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/tonezone.c b/tonezone.c
index 8987061..e31a803 100644
--- a/tonezone.c
+++ b/tonezone.c
@@ -89,7 +89,8 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
 	int firstnobang = -1;
 	int freq1, freq2, time;
 	int modulate = 0;
-	float db, gain;
+	float db = 1.0;
+	float gain;
 	int used = 0;
 	dup = strdup(t->data);
 	s = strtok(dup, ",");
@@ -112,16 +113,13 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
 		} else if (sscanf(s, "%d+%d", &freq1, &freq2) == 2) {
 			PRINT_DEBUG("f1+f2 format: %d, %d\n", freq1, freq2);
 			time = 0;
-			db = 1.0;
 		} else if (sscanf(s, "%d*%d", &freq1, &freq2) == 2) {
 			PRINT_DEBUG("f1+f2 format: %d, %d\n", freq1, freq2);
 			modulate = 1;
 			time = 0;
-			db = 1.0;
 		} else if (sscanf(s, "%d/%d", &freq1, &time) == 2) {
 			PRINT_DEBUG("f1/time format: %d, %d\n", freq1, time);
 			freq2 = 0;
-			db = 1.0;
 		} else if (sscanf(s, "%d@/%d", &freq1, &time) == 2) {
 			/* The "@" character has been added to enable an
  			 * approximately -20db tone generation of any frequency This has been done
@@ -136,7 +134,6 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
 			firstnobang = *count;
 			freq2 = 0;
 			time = 0;
-			db = 1.0;
 		} else {
 			fprintf(stderr, "tone component '%s' of '%s' is a syntax error\n", s,t->data);
 			return -1;

-----------------------------------------------------------------------


-- 
dahdi/tools.git



More information about the dahdi-commits mailing list