[asterisk-commits] rmudgett: branch group/media_formats-reviewed-trunk r418585 - in /team/group/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 14 09:34:41 CDT 2014


Author: rmudgett
Date: Mon Jul 14 09:34:35 2014
New Revision: 418585

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418585
Log:
translate.c: Remove dead struct ast_trans_pvt member explicit_dst.

The struct ast_trans_pvt explicit_dst member is not used by anything and
causes needless refs of formats.

Review: https://reviewboard.asterisk.org/r/3775/

Modified:
    team/group/media_formats-reviewed-trunk/include/asterisk/translate.h
    team/group/media_formats-reviewed-trunk/main/translate.c

Modified: team/group/media_formats-reviewed-trunk/include/asterisk/translate.h
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/include/asterisk/translate.h?view=diff&rev=418585&r1=418584&r2=418585
==============================================================================
--- team/group/media_formats-reviewed-trunk/include/asterisk/translate.h (original)
+++ team/group/media_formats-reviewed-trunk/include/asterisk/translate.h Mon Jul 14 09:34:35 2014
@@ -209,12 +209,6 @@
 struct ast_trans_pvt {
 	struct ast_translator *t;
 	struct ast_frame f;         /*!< used in frameout */
-	/*! If a translation path using a format with attributes requires the output
-	 * to be a specific set of attributes, this variable will be set describing those
-	 * attributes to the translator.  Otherwise, the translator must choose a set
-	 * of format attributes for the destination that preserves the quality of the
-	 * audio in the best way possible. */
-	struct ast_format *explicit_dst;
 	int samples;                /*!< samples available in outbuf */
 	/*! \brief actual space used in outbuf */
 	int datalen;

Modified: team/group/media_formats-reviewed-trunk/main/translate.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats-reviewed-trunk/main/translate.c?view=diff&rev=418585&r1=418584&r2=418585
==============================================================================
--- team/group/media_formats-reviewed-trunk/main/translate.c (original)
+++ team/group/media_formats-reviewed-trunk/main/translate.c Mon Jul 14 09:34:35 2014
@@ -293,7 +293,7 @@
  * \brief Allocate the descriptor, required outbuf space,
  * and possibly desc.
  */
-static void *newpvt(struct ast_translator *t, struct ast_format *explicit_dst)
+static struct ast_trans_pvt *newpvt(struct ast_translator *t)
 {
 	struct ast_trans_pvt *pvt;
 	struct ast_format *dst_format = NULL;
@@ -320,11 +320,6 @@
 	if (t->buf_size) {/* finally buffer and header */
 		pvt->outbuf.c = ofs + AST_FRIENDLY_OFFSET;
 	}
-	/* if a explicit destination format is provided, set that on the pvt so the
-	 * translator will process it. */
-	if (explicit_dst) {
-		ao2_replace(pvt->explicit_dst, explicit_dst);
-	}
 	/* call local init routine, if present */
 	if (t->newpvt && t->newpvt(pvt)) {
 		ast_free(pvt);
@@ -365,7 +360,6 @@
 	if (t->destroy)
 		t->destroy(pvt);
 	ao2_cleanup(pvt->f.subclass.format);
-	ao2_cleanup(pvt->explicit_dst);
 	ast_free(pvt);
 	ast_module_unref(t->module);
 }
@@ -470,7 +464,6 @@
 
 	while (src_index != dst_index) {
 		struct ast_trans_pvt *cur;
-		struct ast_format *explicit_dst = NULL;
 		struct ast_translator *t = matrix_get(src_index, dst_index)->step;
 		if (!t) {
 			ast_log(LOG_WARNING, "No translator path from %s to %s\n",
@@ -478,10 +471,7 @@
 			AST_RWLIST_UNLOCK(&translators);
 			return NULL;
 		}
-		if (dst_index == t->dst_fmt_index) {
-			explicit_dst = dst;
-		}
-		if (!(cur = newpvt(t, explicit_dst))) {
+		if (!(cur = newpvt(t))) {
 			ast_log(LOG_WARNING, "Failed to build translator step from %s to %s\n",
 				ast_format_get_name(src), ast_format_get_name(dst));
 			if (head) {
@@ -619,7 +609,7 @@
 		return;
 	}
 
-	pvt = newpvt(t, NULL);
+	pvt = newpvt(t);
 	if (!pvt) {
 		ast_log(LOG_WARNING, "Translator '%s' appears to be broken and will probably fail.\n", t->name);
 		t->comp_cost = 999999;




More information about the asterisk-commits mailing list