]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a few silly usages of ast_playstream() - it only ever returns 0...
authorJason Parker <jparker@digium.com>
Fri, 22 Jun 2007 14:52:18 +0000 (14:52 +0000)
committerJason Parker <jparker@digium.com>
Fri, 22 Jun 2007 14:52:18 +0000 (14:52 +0000)
Issue 10035

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

file.c
res/res_agi.c

diff --git a/file.c b/file.c
index 15734ecd2e573ab9d20341667ef98f8087f32046..9139b03c833758bb1ab8618529c2a4731c728421 100644 (file)
--- a/file.c
+++ b/file.c
@@ -816,10 +816,9 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
                        return -1;
                if (vfs && ast_applystream(chan, vfs))
                        return -1;
-               if (ast_playstream(fs))
-                       return -1;
-               if (vfs && ast_playstream(vfs))
-                       return -1;
+               ast_playstream(fs);
+               if (vfs)
+                       ast_playstream(vfs);
 #if 1
                if (option_verbose > 2)
                        ast_verbose(VERBOSE_PREFIX_3 "Playing '%s' (language '%s')\n", filename, preflang ? preflang : "default");
index 22a5c29d83439443a1b64d9915563407ed1e5fb7..4d5ede388d993366451270b12ef0c16ba44b7d34 100644 (file)
@@ -569,14 +569,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char
        max_length = ast_tellstream(fs);
        ast_seekstream(fs, sample_offset, SEEK_SET);
        res = ast_applystream(chan, fs);
-       res = ast_playstream(fs);
-       if (res) {
-               fdprintf(agi->fd, "200 result=%d endpos=%ld\n", res, sample_offset);
-               if (res >= 0)
-                       return RESULT_SHOWUSAGE;
-               else
-                       return RESULT_FAILURE;
-       }
+       ast_playstream(fs);
        res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl);
        /* this is to check for if ast_waitstream closed the stream, we probably are at
         * the end of the stream, return that amount, else check for the amount */
@@ -629,14 +622,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, char *
         max_length = ast_tellstream(fs);
         ast_seekstream(fs, sample_offset, SEEK_SET);
         res = ast_applystream(chan, fs);
-        res = ast_playstream(fs);
-        if (res) {
-                fdprintf(agi->fd, "200 result=%d endpos=%ld\n", res, sample_offset);
-                if (res >= 0)
-                        return RESULT_SHOWUSAGE;
-                else
-                        return RESULT_FAILURE;
-        }
+        ast_playstream(fs);
         res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl);
         /* this is to check for if ast_waitstream closed the stream, we probably are at
          * the end of the stream, return that amount, else check for the amount */