]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Handle error response when we can't make file compatible
authorOlle Johansson <oej@edvina.net>
Sat, 11 Sep 2010 16:59:20 +0000 (16:59 +0000)
committerOlle Johansson <oej@edvina.net>
Sat, 11 Sep 2010 16:59:20 +0000 (16:59 +0000)
Review: https://reviewboard.asterisk.org/r/911/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@286267 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/file.c

index f576c853bd5fb22bc32941b3a93df4d75e4b0d05..abb7943d49fe0427ebda16873227e37e1c0da5b0 100644 (file)
@@ -668,7 +668,10 @@ struct ast_filestream *ast_openstream_full(struct ast_channel *chan, const char
        chan->oldwriteformat = chan->writeformat;
        /* Set the channel to a format we can work with */
        res = ast_set_write_format(chan, fmts);
-       res = ast_filehelper(buf, chan, NULL, ACTION_OPEN);
+       if (res == -1) {        /* No format available that works with this channel */
+               return NULL;
+       }
+       res = ast_filehelper(buf, chan, NULL, ACTION_OPEN);
        if (res >= 0)
                return chan->stream;
        return NULL;