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

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