Use Suffix Extensions in Makefiles (doc, src/{arm,dht,integration,statistics}) for...
[oweals/gnunet.git] / src / conversation / gnunet-helper-audio-record.c
index 9caad611ba60ccf7379bc6ac9e630919cac8b49f..82bb6d5b3add5f23898136aaee218376f04f736c 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file conversation/gnunet-helper-audio-record.c
  * OPUS_SIGNAL_VOICE - Bias thresholds towards choosing LPC or Hybrid modes.
  * OPUS_SIGNAL_MUSIC - Bias thresholds towards choosing MDCT modes.
  */
-#define CONV_OPUS_SIGNAL OPUS_AUTO
+#define CONV_OPUS_SIGNAL OPUS_SIGNAL_VOICE
 
 /**
  * Coding mode.
@@ -300,8 +300,8 @@ write_page (ogg_page *og)
   size_t msg_size;
   msg_size = sizeof (struct AudioMessage) + og->header_len + og->body_len;
   audio_message->header.size = htons ((uint16_t) msg_size);
-  memcpy (&audio_message[1], og->header, og->header_len);
-  memcpy (((char *) &audio_message[1]) + og->header_len, og->body, og->body_len);
+  GNUNET_memcpy (&audio_message[1], og->header, og->header_len);
+  GNUNET_memcpy (((char *) &audio_message[1]) + og->header_len, og->body, og->body_len);
 
   toff += msg_size;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -330,7 +330,7 @@ packetizer ()
 
   while (transmit_buffer_length >= transmit_buffer_index + pcm_length)
   {
-    memcpy (pcm_buffer,
+    GNUNET_memcpy (pcm_buffer,
            &transmit_buffer[transmit_buffer_index],
            pcm_length);
     transmit_buffer_index += pcm_length;
@@ -405,8 +405,8 @@ stream_read_callback (pa_stream * s,
   const void *data;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Got %u/%u bytes of PCM data\n",
-             length,
+             "Got %u/%d bytes of PCM data\n",
+             (unsigned int) length,
              pcm_length);
 
   GNUNET_assert (NULL != s);
@@ -428,7 +428,7 @@ stream_read_callback (pa_stream * s,
   {
     transmit_buffer = pa_xrealloc (transmit_buffer,
                                   transmit_buffer_length + length);
-    memcpy (&transmit_buffer[transmit_buffer_length],
+    GNUNET_memcpy (&transmit_buffer[transmit_buffer_length],
            data,
            length);
     transmit_buffer_length += length;
@@ -436,7 +436,7 @@ stream_read_callback (pa_stream * s,
   else
   {
     transmit_buffer = pa_xmalloc (length);
-    memcpy (transmit_buffer, data, length);
+    GNUNET_memcpy (transmit_buffer, data, length);
     transmit_buffer_length = length;
     transmit_buffer_index = 0;
   }
@@ -656,7 +656,7 @@ opus_init ()
   opus_encoder_ctl (enc,
                    OPUS_SET_INBAND_FEC (CONV_OPUS_INBAND_FEC));
   opus_encoder_ctl (enc,
-                   OPUS_SET_SIGNAL (OPUS_SIGNAL_VOICE));
+                   OPUS_SET_SIGNAL (CONV_OPUS_SIGNAL));
 }
 
 static void
@@ -686,7 +686,7 @@ ogg_init ()
     const char *opusver;
     int vendor_length;
 
-    memcpy (headpacket.magic, "OpusHead", 8);
+    GNUNET_memcpy (headpacket.magic, "OpusHead", 8);
     headpacket.version = 1;
     headpacket.channels = CHANNELS;
     headpacket.preskip = GNUNET_htole16 (0);
@@ -718,14 +718,14 @@ ogg_init ()
     if (NULL == commentspacket)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 _("Failed to allocate %d bytes for second packet\n"),
-                  commentspacket_len);
+                 _("Failed to allocate %u bytes for second packet\n"),
+                  (unsigned int) commentspacket_len);
       exit (5);
     }
 
-    memcpy (commentspacket->magic, "OpusTags", 8);
+    GNUNET_memcpy (commentspacket->magic, "OpusTags", 8);
     commentspacket->vendor_length = GNUNET_htole32 (vendor_length);
-    memcpy (&commentspacket[1], opusver, vendor_length);
+    GNUNET_memcpy (&commentspacket[1], opusver, vendor_length);
     *(uint32_t *) &((char *) &commentspacket[1])[vendor_length] = \
         GNUNET_htole32 (0); /* no tags */