diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-15 00:01:22 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-15 00:01:22 +0000 |
commit | 9aa591bc08a7494c1e12218cfed9d45fb41ce8cc (patch) | |
tree | f297bb0c48dfa1a81c98ce006b30f7307ee0e973 /main/app.c | |
parent | d671919ba01f84063702cbbf80176ec7354563b6 (diff) |
Merged revisions 89275 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r89275 | tilghman | 2007-11-14 17:23:58 -0600 (Wed, 14 Nov 2007) | 5 lines
When a recording ends with '#', we are improperly trimming an extra 200ms from the recording.
Reported by: sim
Patch by: tilghman
Closes issue #11247
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89276 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/main/app.c b/main/app.c index f21a40e47..defad777a 100644 --- a/main/app.c +++ b/main/app.c @@ -767,8 +767,13 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile, for (x = 0; x < fmtcnt; x++) { if (!others[x]) break; - if (res > 0) - ast_stream_rewind(others[x], totalsilence ? totalsilence - 200 : 200); + /*!\note + * If we ended with silence, trim all but the first 200ms of silence + * off the recording. However, if we ended with '#', we don't want + * to trim ANY part of the recording. + */ + if (res > 0 && totalsilence) + ast_stream_rewind(others[x], totalsilence - 200); ast_truncstream(others[x]); ast_closestream(others[x]); } @@ -783,7 +788,9 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile, realfiles[x] = ast_readfile(recordfile, sfmt[x], comment, O_RDONLY, 0, 0); if (!others[x] || !realfiles[x]) break; - ast_stream_rewind(others[x], totalsilence ? totalsilence - 200 : 200); + /*!\note Same logic as above. */ + if (totalsilence) + ast_stream_rewind(others[x], totalsilence - 200); ast_truncstream(others[x]); /* add the original file too */ while ((fr = ast_readframe(realfiles[x]))) { |