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

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