mirror of
https://github.com/asterisk/asterisk.git
synced 2026-01-06 01:51:14 +00:00
Version 0.3.0 from FTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -227,7 +227,7 @@ static void calc_cost(struct ast_translator *t)
|
|||||||
}
|
}
|
||||||
gettimeofday(&start, NULL);
|
gettimeofday(&start, NULL);
|
||||||
/* Call the encoder until we've processed one second of time */
|
/* Call the encoder until we've processed one second of time */
|
||||||
while(sofar < 1000) {
|
while(sofar < 8000) {
|
||||||
f = t->sample();
|
f = t->sample();
|
||||||
if (!f) {
|
if (!f) {
|
||||||
ast_log(LOG_WARNING, "Translator '%s' failed to produce a sample frame.\n", t->name);
|
ast_log(LOG_WARNING, "Translator '%s' failed to produce a sample frame.\n", t->name);
|
||||||
@@ -238,7 +238,7 @@ static void calc_cost(struct ast_translator *t)
|
|||||||
t->framein(pvt, f);
|
t->framein(pvt, f);
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
while((out = t->frameout(pvt))) {
|
while((out = t->frameout(pvt))) {
|
||||||
sofar += out->timelen;
|
sofar += out->samples;
|
||||||
ast_frfree(out);
|
ast_frfree(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,6 +246,8 @@ static void calc_cost(struct ast_translator *t)
|
|||||||
t->destroy(pvt);
|
t->destroy(pvt);
|
||||||
cost = (finish.tv_sec - start.tv_sec) * 1000 + (finish.tv_usec - start.tv_usec) / 1000;
|
cost = (finish.tv_sec - start.tv_sec) * 1000 + (finish.tv_usec - start.tv_usec) / 1000;
|
||||||
t->cost = cost;
|
t->cost = cost;
|
||||||
|
if (!t->cost)
|
||||||
|
t->cost = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int show_translation(int fd, int argc, char *argv[])
|
static int show_translation(int fd, int argc, char *argv[])
|
||||||
|
|||||||
Reference in New Issue
Block a user