[asterisk-commits] branch file/coremedia - r7426 in /team/file/coremedia: channel.c coremedia.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Dec 10 18:35:22 CST 2005


Author: file
Date: Sat Dec 10 18:35:20 2005
New Revision: 7426

URL: http://svn.digium.com/view/asterisk?rev=7426&view=rev
Log:
Copy over sample rate from shims, and if not present - assume 8000

Modified:
    team/file/coremedia/channel.c
    team/file/coremedia/coremedia.c

Modified: team/file/coremedia/channel.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/channel.c?rev=7426&r1=7425&r2=7426&view=diff
==============================================================================
--- team/file/coremedia/channel.c (original)
+++ team/file/coremedia/channel.c Sat Dec 10 18:35:20 2005
@@ -2746,16 +2746,16 @@
 int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *peer)
 {
 
-  /* Make both sides compatible through the coremedia core */
-  if (chan->nativeformat != peer->nativeformat) {
-    /* Route everything through signed linear */
-    ast_set_read_format_cm(chan, NULL);
-    ast_set_write_format_cm(chan, NULL);
-    ast_set_read_format_cm(peer, NULL);
-    ast_set_write_format_cm(peer, NULL);
-  }
-
-  return 0;
+	/* Make both sides compatible through the coremedia core */
+	if (chan->nativeformat != peer->nativeformat) {
+		/* Route everything through signed linear */
+		ast_set_read_format_cm(chan, NULL);
+		ast_set_write_format_cm(chan, NULL);
+		ast_set_read_format_cm(peer, NULL);
+		ast_set_write_format_cm(peer, NULL);
+	}
+	
+	return 0;
 }
 
 int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone)

Modified: team/file/coremedia/coremedia.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/coremedia.c?rev=7426&r1=7425&r2=7426&view=diff
==============================================================================
--- team/file/coremedia/coremedia.c (original)
+++ team/file/coremedia/coremedia.c Sat Dec 10 18:35:20 2005
@@ -168,6 +168,9 @@
 	memset(new_shim, 0, sizeof(struct ast_coremedia_shim));
 	new_shim->callback = shim->callback;
 	new_shim->destroy = shim->destroy;
+	new_shim->sample_rate = shim->sample_rate;
+	if (new_shim->sample_rate <= 0)
+	  new_shim->sample_rate = 8000;
 	/* Link the created pvt structure to the new shim */
 	new_shim->pvt = pvt;
 	/* Make sure we have no next */
@@ -402,6 +405,9 @@
 	struct timeval delivery;
 	struct ast_frame *frame = NULL, *shim_frame = NULL;
 	struct ast_coremedia_shim *shim = NULL;
+
+	if (f == NULL)
+	  return NULL;
 
 	/* Do our pass through the decoder if available */
 	if (path->decoder != NULL) {



More information about the asterisk-commits mailing list