123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- Description: Only write audio data to a file in debug builds
- This isn't useful in regular builds and is actually a security
- concern.
- From: Rui Matos <tiagomatos@gmail.com>
- Date: Mon, 6 Jan 2014 13:45:00 +0000
- Bug-Debian: http://bugs.debian.org/734746
- Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1048678
- Source: https://bugzilla.redhat.com/attachment.cgi?id=846118
- ---
- src/audio/auserver.c | 6 ++++++
- 1 file changed, 6 insertions(+)
- --- a/src/audio/auserver.c
- +++ b/src/audio/auserver.c
- @@ -62,9 +62,11 @@
- int q,i,n,r;
- unsigned char bytes[CST_AUDIOBUFFSIZE];
- short shorts[CST_AUDIOBUFFSIZE];
- +#ifdef DEBUG
- cst_file fff;
-
- fff = cst_fopen("/tmp/awb.wav",CST_OPEN_WRITE|CST_OPEN_BINARY);
- +#endif
-
- if ((audio_device = audio_open(header->sample_rate,1,
- (header->encoding == CST_SND_SHORT) ?
- @@ -111,7 +113,9 @@
- for (q=r; q > 0; q-=n)
- {
- n = audio_write(audio_device,shorts,q);
- +#ifdef DEBUG
- cst_fwrite(fff,shorts,2,q);
- +#endif
- if (n <= 0)
- {
- audio_close(audio_device);
- @@ -120,7 +124,9 @@
- }
- }
- audio_close(audio_device);
- +#ifdef DEBUG
- cst_fclose(fff);
- +#endif
-
- return CST_OK_FORMAT;
-
|