diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-10-06 13:48:27 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-10-06 13:48:27 +0000 |
commit | 98bbe79d6eeb1744eb9cc8d4044b4f8776b907bb (patch) | |
tree | 9f28da06e608f2b5dac46f7e5f600b846b7191fe /main/file.c | |
parent | f0900c16b80cc961ed64cb67fb20b2b8a4e235be (diff) |
Allow streaming audio from a pipe.
(closes issue #18001)
Reported by: jamicque
Patches:
20100926__issue18001.diff.txt uploaded by tilghman (license 14)
Tested by: jamicque
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@290575 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/file.c')
-rw-r--r-- | main/file.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/main/file.c b/main/file.c index ae67f8bc9..20cda4929 100644 --- a/main/file.c +++ b/main/file.c @@ -961,10 +961,12 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p * done this way because there is no where for ast_openstream_full to * return the file had no data. */ seekattempt = fseek(fs->f, -1, SEEK_END); - if (!seekattempt) - ast_seekstream(fs, 0, SEEK_SET); - else + if (seekattempt && errno == EINVAL) { + /* Zero-length file, as opposed to a pipe */ return 0; + } else { + ast_seekstream(fs, 0, SEEK_SET); + } vfs = ast_openvstream(chan, filename, preflang); if (vfs) { |