]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix MODLANG-43
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 23 Oct 2007 18:25:58 +0000 (18:25 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 23 Oct 2007 18:25:58 +0000 (18:25 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6034 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_spidermonkey/mod_spidermonkey.c

index 18e627851e6e12815cb395acfbbac959cdfc6140..784859b0a2aa064ea9ed732b3acd40cc78eb4f59 100644 (file)
@@ -1097,14 +1097,14 @@ static switch_status_t js_stream_input_callback(switch_core_session_t *session,
                        }
                        return SWITCH_STATUS_SUCCESS;
                } else if (!strcasecmp(ret, "restart")) {
-                       unsigned int pos = 0;
+                       uint32_t pos = 0;
                        fh->speed = 0;
                        switch_core_file_seek(fh, &pos, 0, SEEK_SET);
                        return SWITCH_STATUS_SUCCESS;
                } else if (!strncasecmp(ret, "seek", 4)) {
                        switch_codec_t *codec;
-                       unsigned int samps = 0;
-                       unsigned int pos = 0;
+                       uint32_t samps = 0;
+                       uint32_t pos = 0;
                        char *p;
                        codec = switch_core_session_get_read_codec(jss->session);
 
@@ -1119,7 +1119,7 @@ static switch_status_t js_stream_input_callback(switch_core_session_t *session,
                                                samps = step * (codec->implementation->actual_samples_per_second / 1000);
                                                switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
                                        } else {
-                                               samps = step * (codec->implementation->actual_samples_per_second / 1000);
+                                               samps = abs(step) * (codec->implementation->actual_samples_per_second / 1000);
                                                switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
                                        }
                                } else {