aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-06 13:49:19 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-06 13:49:19 +0000
commit578ec6f649f6b20aeee573f7fcda18ad3a8d6670 (patch)
treeaa7679c18741e12c943b3433d8b5f95bbf59bbbf
parent809cf473f24c825adfd3fcb217a0ec580327b295 (diff)
Merged revisions 290575 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r290575 | tilghman | 2010-10-06 08:48:27 -0500 (Wed, 06 Oct 2010) | 8 lines 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.8@290576 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/file.c b/main/file.c
index 97e3720f1..76212d093 100644
--- a/main/file.c
+++ b/main/file.c
@@ -959,10 +959,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) {