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

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