translate.c: Prefer better codecs upon translate ties.

If multiple codecs are available for the same
resource and the translation costs between
multiple codecs are the same, ties are
currently broken arbitrarily, which means a
lower quality codec would be used. This forces
Asterisk to explicitly use the higher quality
codec, ceteris paribus.

ASTERISK-29455

Change-Id: I4b7297e1baca7aac14fe4a3c7538e18e2dbe9fd6
This commit is contained in:
Naveen Albert
2021-05-27 15:32:21 -04:00
committed by Friendly Automation
parent 80e9e77261
commit 5e35862109
5 changed files with 67 additions and 3 deletions

View File

@@ -78,6 +78,8 @@ struct ast_codec {
unsigned int smooth;
/*! \brief Flags to be passed to the smoother */
unsigned int smoother_flags;
/*! \brief Format quality, on scale from 0 to 150 (100 is ulaw, the reference). This allows better format to be used, ceterus paribus. */
unsigned int quality;
/*! \brief The module that registered this codec */
struct ast_module *mod;
};