]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 286268 via svnmerge from
authorOlle Johansson <oej@edvina.net>
Sat, 11 Sep 2010 17:09:22 +0000 (17:09 +0000)
committerOlle Johansson <oej@edvina.net>
Sat, 11 Sep 2010 17:09:22 +0000 (17:09 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r286268 | oej | 2010-09-11 19:05:16 +0200 (Lör, 11 Sep 2010) | 11 lines

  Merged revisions 286267 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r286267 | oej | 2010-09-11 18:59:20 +0200 (Lör, 11 Sep 2010) | 4 lines

    Handle error response when we can't make file compatible

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

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

main/file.c

index 726a72b64abf7d5c71fa6c9166d16f1879004921..97e3720f11195acdac7240b0af0ddddac830256e 100644 (file)
@@ -651,7 +651,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;