aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-06-29 04:50:45 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-06-29 04:50:45 +0000
commit8570dda2f081da4e480af6baf8a5df6cd8611760 (patch)
tree2ea6eb0727c19453e5fea74a3e1d2d1c39a500d3 /file.c
parent83cfc475d98496f283b49734635d486e4eea9924 (diff)
Minor fixes to playback logic
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1134 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'file.c')
-rwxr-xr-xfile.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/file.c b/file.c
index 79329c47e..4f684ae8c 100755
--- a/file.c
+++ b/file.c
@@ -601,12 +601,13 @@ int ast_closestream(struct ast_filestream *f)
{
/* Stop a running stream if there is one */
if (f->owner) {
- f->owner->stream = NULL;
if (f->fmt->format < AST_FORMAT_MAX_AUDIO) {
+ f->owner->stream = NULL;
if (f->owner->streamid > -1)
ast_sched_del(f->owner->sched, f->owner->streamid);
f->owner->streamid = -1;
} else {
+ f->owner->vstream = NULL;
if (f->owner->vstreamid > -1)
ast_sched_del(f->owner->sched, f->owner->vstreamid);
f->owner->vstreamid = -1;
@@ -766,7 +767,10 @@ char ast_waitstream(struct ast_channel *c, char *breakon)
while(c->stream) {
res = ast_sched_wait(c->sched);
if (res < 0) {
- ast_closestream(c->stream);
+ if (c->stream)
+ ast_closestream(c->stream);
+ if (c->vstream)
+ ast_closestream(c->vstream);
break;
}
/* Setup timeout if supported */
@@ -822,7 +826,10 @@ char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char
while(c->stream) {
res = ast_sched_wait(c->sched);
if (res < 0) {
- ast_closestream(c->stream);
+ if (c->stream)
+ ast_closestream(c->stream);
+ if (c->vstream)
+ ast_closestream(c->vstream);
break;
}
ast_settimeout(c, res);
@@ -886,7 +893,10 @@ char ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int
while(c->stream) {
ms = ast_sched_wait(c->sched);
if (ms < 0) {
- ast_closestream(c->stream);
+ if (c->stream)
+ ast_closestream(c->stream);
+ if (c->vstream)
+ ast_closestream(c->vstream);
break;
}
ast_settimeout(c, ms);