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