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

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