]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5242
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 21 May 2013 15:03:22 +0000 (10:03 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 21 May 2013 15:03:36 +0000 (10:03 -0500)
src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
src/switch_ivr.c
src/switch_ivr_play_say.c

index 434c412cbfce4c5423aafa28d4158e4b1e7ed935..552c2c45f01f9898b62bef4c943344970e3386c1 100644 (file)
@@ -1300,14 +1300,14 @@ static switch_status_t js_stream_input_callback(switch_core_session_t *session,
                                                step = 1000;
                                        }
                                        if (step > 0) {
-                                               samps = step * (fh->samplerate / 1000);
+                                               samps = step * (fh->native_rate / 1000);
                                                switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
                                        } else {
-                                               samps = abs(step) * (fh->samplerate / 1000);
+                                               samps = abs(step) * (fh->native_rate / 1000);
                                                switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
                                        }
                                } else {
-                                       samps = atoi(p) * (fh->samplerate / 1000);
+                                       samps = atoi(p) * (fh->native_rate / 1000);
                                        switch_core_file_seek(fh, &pos, samps, SEEK_SET);
                                }
                        }
index 81acf5afc5bbac082c6954fd6a7a31cc1926822b..046b8f0130a12fe841456e4990b0208f8604f10b 100644 (file)
@@ -3384,7 +3384,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_process_fh(switch_core_session_t *ses
                                                step = 1000;
                                        }
 
-                                       samps = step * (fhp->samplerate / 1000);
+                                       samps = step * (fhp->native_rate / 1000);
                                        target = (int32_t)fhp->pos + samps;
 
                                        if (target < 0) {
@@ -3395,7 +3395,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_process_fh(switch_core_session_t *ses
                                        switch_core_file_seek(fhp, &pos, target, SEEK_SET);
 
                                } else {
-                                       samps = switch_atoui(p) * (fhp->samplerate / 1000);
+                                       samps = switch_atoui(p) * (fhp->native_rate / 1000);
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "seek to position %d\n", samps);
                                        switch_core_file_seek(fhp, &pos, samps, SEEK_SET);
                                }
index 3ce8b6bc723fa40d0bd33ca7ae7f73b236ff0866..b632302f86e62d714e2a0ad25d35726d9807fbf3 100644 (file)
@@ -797,8 +797,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
        }
 
        if (read_impl.actual_samples_per_second) {
-               switch_channel_set_variable_printf(channel, "record_seconds", "%d", fh->samples_out / fh->samplerate);
-               switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (fh->samplerate/ 1000));
+               switch_channel_set_variable_printf(channel, "record_seconds", "%d", fh->samples_out / fh->native_rate);
+               switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (fh->native_rate/ 1000));
 
        }
 
@@ -1693,8 +1693,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "done playing file %s\n", file);
 
                if (read_impl.samples_per_second) {
-                       switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_in / fh->samplerate);
-                       switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_in / fh->samplerate);
+                       switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_in / fh->native_rate);
+                       switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_in / fh->native_rate);
                }
                switch_channel_set_variable_printf(channel, "playback_samples", "%d", fh->samples_in);