[Freeswitch-dev] r9246 - in freeswitch/trunk/src: . include

UV uv at talknet.com.au
Tue Aug 12 13:25:52 EDT 2008


This change causes FS to not build successfully on Win32:

error C2220: warning treated as error - no 'object' file generated
switch_ivr_originate.c  424

warning C4244: '*=': conversion from 'double' to 'switch_size_t', possible
loss of data         switch_ivr_originate.c  424

warning C4244: '*=': conversion from 'double' to 'switch_size_t', possible
loss of data         switch_ivr_originate.c  1228

 

This can be easily resolved by removing the /WX switch (Treat Warning as
Errors) from FreeSwitchCoreLib but I wanted to alert about it before
suggesting it.

 

… I wonder if posts here actually get anywhere …

 

-----Original Message-----
From: freeswitch-svn-bounces at lists.freeswitch.org
[mailto:freeswitch-svn-bounces at lists.freeswitch.org] On Behalf Of Freeswitch
SVN
Sent: Tuesday, August 12, 2008 6:41 AM
To: freeswitch-svn at lists.freeswitch.org
Subject: [Freeswitch-svn] [commit] r9246 - in freeswitch/trunk/src: .
include

 

Author: anthm

Date: Mon Aug 11 16:41:18 2008

New Revision: 9246

 

Modified:

   freeswitch/trunk/src/include/switch_resample.h

   freeswitch/trunk/src/switch_ivr_originate.c

   freeswitch/trunk/src/switch_resample.c

 

Log:

fix resampled file in ringback issue from mailing list

 

Modified: freeswitch/trunk/src/include/switch_resample.h

============================================================================
==

--- freeswitch/trunk/src/include/switch_resample.h    (original)

+++ freeswitch/trunk/src/include/switch_resample.h    Mon Aug 11 16:41:18
2008

@@ -60,6 +60,7 @@

      int to_rate;

      /*! the factor to resample by (from / to) */

      double factor;

+     double rfactor;

      /*! a pointer to store a float buffer for data to be resampled */

      float *from;

      /*! the size of the from buffer used */

 

Modified: freeswitch/trunk/src/switch_ivr_originate.c

============================================================================
==

--- freeswitch/trunk/src/switch_ivr_originate.c (original)

+++ freeswitch/trunk/src/switch_ivr_originate.c Mon Aug 11 16:41:18 2008

@@ -420,6 +420,9 @@

                        }

 

                        olen = mlen;

+                       if (ringback.fh->resampler) {

+                             olen *= ringback.fh->resampler->rfactor;

+                       }

                        switch_core_file_read(ringback.fh, write_frame.data,
&olen);

 

                        if (olen == 0) {

@@ -1200,6 +1203,10 @@

                                          }

 

                                          olen = mlen;

+                                         if (ringback.fh->resampler) {

+                                               olen *=
ringback.fh->resampler->rfactor;

+                                         }

+                                         

                                          switch_core_file_read(ringback.fh,
write_frame.data, &olen);

 

                                          if (olen == 0) {

 

Modified: freeswitch/trunk/src/switch_resample.c

============================================================================
==

--- freeswitch/trunk/src/switch_resample.c      (original)

+++ freeswitch/trunk/src/switch_resample.c      Mon Aug 11 16:41:18 2008

@@ -72,6 +72,7 @@

      lto_rate = (double) resampler->to_rate;

      lfrom_rate = (double) resampler->from_rate;

      resampler->factor = (lto_rate / lfrom_rate);

+     resampler->rfactor = (lfrom_rate / lto_rate);

 

      resampler->resampler = resample_open(QUALITY, resampler->factor,
resampler->factor);

      switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Activate
Resampler %d->%d %f\n", resampler->from_rate, resampler->to_rate,

 

 

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.6.1/1605 - Release Date: 11/08/2008
16:59


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20080813/5ea08ea8/attachment.html 


More information about the Freeswitch-dev mailing list