Maybe we should set the value before we test it? Fixes an issue people have been...
authorJason Parker <jparker@digium.com>
Tue, 19 Feb 2008 22:23:04 +0000 (22:23 +0000)
committerJason Parker <jparker@digium.com>
Tue, 19 Feb 2008 22:23:04 +0000 (22:23 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103831 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 830775f..cece084 100644 (file)
@@ -3095,13 +3095,14 @@ static int set_format(struct ast_channel *chan, int fmt, int *rawformat, int *fo
        int native;
        int res;
 
+       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;
        
-       native = chan->nativeformats;
        /* Find a translation path from the native format to one of the desired formats */
        if (!direction)
                /* reading */