]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Sun, 8 Apr 2007 02:56:53 +0000 (02:56 +0000)
committerAutomerge Script <automerge@asterisk.org>
Sun, 8 Apr 2007 02:56:53 +0000 (02:56 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@60708 65c4cc65-6c06-0410-ace0-fbb531ad65f3

file.c

diff --git a/file.c b/file.c
index 1067f7ff3533c87c5fc4a4e25c96c73a93d53c49..15734ecd2e573ab9d20341667ef98f8087f32046 100644 (file)
--- a/file.c
+++ b/file.c
@@ -427,10 +427,15 @@ static int ast_filehelper(const char *filename, const char *filename2, const cha
                                                                                s->fmt = f;
                                                                                s->trans = NULL;
                                                                                s->filename = NULL;
-                                                                               if (s->fmt->format < AST_FORMAT_MAX_AUDIO)
+                                                                               if (s->fmt->format < AST_FORMAT_MAX_AUDIO) {
+                                                                                       if (chan->stream)
+                                                                                               ast_closestream(chan->stream);
                                                                                        chan->stream = s;
-                                                                               else
+                                                                               } else {
+                                                                                       if (chan->vstream)
+                                                                                               ast_closestream(chan->vstream);
                                                                                        chan->vstream = s;
+                                                                               }
                                                                        } else {
                                                                                fclose(bfile);
                                                                                ast_log(LOG_WARNING, "Unable to open file on %s\n", fn);