mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Merge "translate: Transcode siren14, speex32, silk24, and silk12 via slin16."
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "asterisk/lock.h"
|
#include "asterisk/lock.h"
|
||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
@@ -1413,6 +1414,20 @@ int ast_translator_best_choice(struct ast_format_cap *dst_cap,
|
|||||||
ao2_replace(bestdst, dst);
|
ao2_replace(bestdst, dst);
|
||||||
besttablecost = matrix_get(x, y)->table_cost;
|
besttablecost = matrix_get(x, y)->table_cost;
|
||||||
beststeps = matrix_get(x, y)->multistep;
|
beststeps = matrix_get(x, y)->multistep;
|
||||||
|
} else if (matrix_get(x, y)->table_cost == besttablecost
|
||||||
|
&& matrix_get(x, y)->multistep == beststeps) {
|
||||||
|
int gap_selected = abs(ast_format_get_sample_rate(best)
|
||||||
|
- ast_format_get_sample_rate(bestdst));
|
||||||
|
int gap_current = abs(ast_format_get_sample_rate(src)
|
||||||
|
- ast_format_get_sample_rate(dst));
|
||||||
|
|
||||||
|
if (gap_current < gap_selected) {
|
||||||
|
/* better than what we have so far */
|
||||||
|
ao2_replace(best, src);
|
||||||
|
ao2_replace(bestdst, dst);
|
||||||
|
besttablecost = matrix_get(x, y)->table_cost;
|
||||||
|
beststeps = matrix_get(x, y)->multistep;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user