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

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