[Pkg-voip-commits] [dahdi-tools] 95/285: dahdi-monitor: Fix broken control-C behavior and -F output option

tzafrir at debian.org tzafrir at debian.org
Thu Jul 7 19:18:37 UTC 2016


This is an automated email from the git hooks/post-receive script.

tzafrir pushed a commit to branch master
in repository dahdi-tools.

commit 79ed81f9f5f16cd23552719d80e773d3a7e56073
Author: Russ Meyerriecks <rmeyerriecks at digium.com>
Date:   Fri Sep 21 17:25:48 2012 +0000

    dahdi-monitor: Fix broken control-C behavior and -F output option
    
    After hitting control-C when writing a wav file, dahdi_monitor reports
    "Failed to read in a full wav header. Expect bad things."
    
    Also when using the -F output option, the wav header is not written.
    
    Reported-by: Richard Miller
    Internal-Issue-ID: DAHTOOL-59
    Patch: dahdi_monitor.diff by Richard Miller (license #5685)
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
    
    git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10717 17933a7a-c749-41c5-a318-cba88f637d49
---
 dahdi_monitor.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/dahdi_monitor.c b/dahdi_monitor.c
index e61b610..79f46dd 100644
--- a/dahdi_monitor.c
+++ b/dahdi_monitor.c
@@ -427,6 +427,14 @@ int main(int argc, char *argv[])
 				exit(EXIT_FAILURE);
 			}
 			fprintf(stderr, "Writing pre-echo combined stream to %s\n", optarg);
+			file_is_wav[MON_PRE_BRX] = filename_is_wav(optarg);
+			if (file_is_wav[MON_PRE_BRX]) {
+				wavheader_init(&wavheaders[MON_PRE_BRX], 1);
+				if (fwrite(&wavheaders[MON_PRE_BRX], 1, sizeof(struct wavheader), ofh[MON_PRE_BRX]) != sizeof(struct wavheader)) {
+					fprintf(stderr, "Could not write wav header to %s: %s\n", optarg, strerror(errno));
+					exit(EXIT_FAILURE);
+				}
+			}
 			preecho = 1;
 			savefile = 1;
 			break;
@@ -763,12 +771,6 @@ int main(int argc, char *argv[])
 		if (!(file_is_wav[i]))
 			continue;
 
-		rewind(ofh[i]);
-
-		if (fread(&wavheaders[i], 1, sizeof(struct wavheader), ofh[i]) != sizeof(struct wavheader)) {
-			fprintf(stderr, "Failed to read in a full wav header.  Expect bad things.\n");
-		}
-
 		wavheaders[i].riff_chunk_size = (bytes_written[i]) + sizeof(struct wavheader) - 8; /* filesize - 8 */
 		wavheaders[i].data_data_size = bytes_written[i];
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/dahdi-tools.git



More information about the Pkg-voip-commits mailing list