From 63ab8ad66c9d28f6135c1c825952905cb61b1cd5 Mon Sep 17 00:00:00 2001
From: Jason Parker <jparker@digium.com>
Date: Tue, 19 Feb 2008 22:35:23 +0000
Subject: [PATCH] Make sure to mask out non-audio first as well

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/channel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/main/channel.c b/main/channel.c
index cece084fbd..ecebc70625 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3095,14 +3095,14 @@ static int set_format(struct ast_channel *chan, int fmt, int *rawformat, int *fo
 	int native;
 	int res;
 
+	/* Make sure we only consider audio */
+	fmt &= AST_FORMAT_AUDIO_MASK;
+	
 	native = chan->nativeformats;
 
 	if (!fmt || !native)	/* No audio requested */
 		return 0;	/* Let's try a call without any sounds (video, text) */
 	
-	/* Make sure we only consider audio */
-	fmt &= AST_FORMAT_AUDIO_MASK;
-	
 	/* Find a translation path from the native format to one of the desired formats */
 	if (!direction)
 		/* reading */
-- 
GitLab