Blame SOURCES/0001-auserver.c-Only-write-audio-data-to-a-file-in-debug-.patch

bb5a66
From a85193f122b7ec0d377e0a39ac58c64f12c51085 Mon Sep 17 00:00:00 2001
bb5a66
From: Rui Matos <tiagomatos@gmail.com>
bb5a66
Date: Mon, 6 Jan 2014 13:45:00 +0000
bb5a66
Subject: [PATCH] auserver.c: Only write audio data to a file in debug builds
bb5a66
bb5a66
This isn't useful in regular builds and is actually a security
bb5a66
concern.
bb5a66
---
bb5a66
 src/audio/auserver.c | 6 ++++++
bb5a66
 1 file changed, 6 insertions(+)
bb5a66
bb5a66
diff --git a/src/audio/auserver.c b/src/audio/auserver.c
bb5a66
index 29716d3..3e838d0 100644
bb5a66
--- a/src/audio/auserver.c
bb5a66
+++ b/src/audio/auserver.c
bb5a66
@@ -58,9 +58,11 @@ static int play_wave_from_socket(snd_header *header,int audiostream)
bb5a66
     int q,i,n,r;
bb5a66
     unsigned char bytes[CST_AUDIOBUFFSIZE];
bb5a66
     short shorts[CST_AUDIOBUFFSIZE];
bb5a66
+#ifdef DEBUG
bb5a66
     cst_file fff;
bb5a66
 
bb5a66
     fff = cst_fopen("/tmp/awb.wav",CST_OPEN_WRITE|CST_OPEN_BINARY);
bb5a66
+#endif
bb5a66
 
bb5a66
     if ((audio_device = audio_open(header->sample_rate,1,
bb5a66
 				   (header->encoding == CST_SND_SHORT) ?
bb5a66
@@ -107,7 +109,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream)
bb5a66
 	for (q=r; q > 0; q-=n)
bb5a66
 	{
bb5a66
 	    n = audio_write(audio_device,shorts,q);
bb5a66
+#ifdef DEBUG
bb5a66
 	    cst_fwrite(fff,shorts,2,q);
bb5a66
+#endif
bb5a66
 	    if (n <= 0)
bb5a66
 	    {
bb5a66
 		audio_close(audio_device);
bb5a66
@@ -116,7 +120,9 @@ static int play_wave_from_socket(snd_header *header,int audiostream)
bb5a66
 	}
bb5a66
     }
bb5a66
     audio_close(audio_device);
bb5a66
+#ifdef DEBUG
bb5a66
     cst_fclose(fff);
bb5a66
+#endif
bb5a66
 
bb5a66
     return CST_OK_FORMAT;
bb5a66
 
bb5a66
-- 
bb5a66
1.8.3.1
bb5a66