log: add \n
[oweals/gnunet.git] / src / conversation / gnunet-helper-audio-playback.c
index 7e0fb02838b1265c0473eb9b5821e76fd1176896..e965cb2aaa0c259a05a93b9b8e729f5ceb8c5f2b 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (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
@@ -151,7 +151,7 @@ process_header (ogg_packet *op)
 
   if (op->bytes < sizeof (header))
     return NULL;
-  memcpy (&header, op->packet, sizeof (header));
+  GNUNET_memcpy (&header, op->packet, sizeof (header));
   header.preskip = GNUNET_le16toh (header.preskip);
   header.sampling_rate = GNUNET_le32toh (header.sampling_rate);
   header.gain = GNUNET_le16toh (header.gain);
@@ -173,15 +173,15 @@ process_header (ogg_packet *op)
   dec = opus_decoder_create (SAMPLING_RATE, channels, &err);
   if (OPUS_OK != err)
   {
-    fprintf (stderr, 
-            "Cannot create encoder: %s\n", 
+    fprintf (stderr,
+            "Cannot create encoder: %s\n",
             opus_strerror (err));
     return NULL;
   }
   if (! dec)
   {
     fprintf (stderr,
-            "Decoder initialization failed: %s\n", 
+            "Decoder initialization failed: %s\n",
             opus_strerror (err));
     return NULL;
   }
@@ -209,7 +209,7 @@ process_header (ogg_packet *op)
 
 
 #ifdef DEBUG_DUMP_DECODED_OGG
-static size_t 
+static size_t
 fwrite_le32(opus_int32 i32, FILE *file)
 {
    unsigned char buf[4];
@@ -221,7 +221,7 @@ fwrite_le32(opus_int32 i32, FILE *file)
 }
 
 
-static size_t 
+static size_t
 fwrite_le16(int i16, FILE *file)
 {
    unsigned char buf[2];
@@ -292,9 +292,11 @@ audio_write (int64_t maxout)
       int64_t wrote = 0;
       wrote = to_write;
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Writing %u * %u * %u = %u bytes into PA\n",
-                  to_write, channels, sizeof (float),
-                  to_write * channels * sizeof (float));
+                  "Writing %u * %u * %u = %llu bytes into PA\n",
+                  to_write,
+                  channels,
+                  (unsigned int) sizeof (float),
+                  (unsigned long long) (to_write * channels * sizeof (float)));
 #ifdef DEBUG_DUMP_DECODED_OGG
       if (dump_to_stdout)
       {
@@ -453,12 +455,14 @@ ogg_demux_and_decode ()
           so that we can adjust the timestamp counting.*/
         gran_offset = preskip;
 
-        if (!pcm_buffer)
+        if (! pcm_buffer)
         {
           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Allocating %u * %u * %u = %u bytes of buffer space\n",
-                  MAX_FRAME_SIZE, channels, sizeof (float),
-                  MAX_FRAME_SIZE * channels * sizeof (float));
+                      "Allocating %u * %u * %u = %llu bytes of buffer space\n",
+                      MAX_FRAME_SIZE,
+                      channels,
+                      (unsigned int) sizeof (float),
+                      (unsigned long long) (MAX_FRAME_SIZE * channels * sizeof (float)));
           pcm_buffer = pa_xmalloc (sizeof (float) * MAX_FRAME_SIZE * channels);
         }
       }
@@ -501,7 +505,9 @@ ogg_demux_and_decode ()
         frame_size = ret;
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     "Decoded %d bytes/channel (%d bytes) from %u compressed bytes\n",
-                    ret, ret * channels, op.bytes);
+                    ret,
+                    ret * channels,
+                    (unsigned int) op.bytes);
 
         /*Apply header gain, if we're not using an opus library new
           enough to do this internally.*/
@@ -559,7 +565,7 @@ stdin_receiver (void *cls,
     /*Get the ogg buffer for writing*/
     data = ogg_sync_buffer (&oy, payload_len);
     /*Read bitstream from input file*/
-    memcpy (data, (const unsigned char *) &audio[1], payload_len);
+    GNUNET_memcpy (data, (const unsigned char *) &audio[1], payload_len);
     ogg_sync_wrote (&oy, payload_len);
 
     ogg_demux_and_decode ();
@@ -790,7 +796,7 @@ main (int argc, char *argv[])
     if (read_pure_ogg)
     {
       char *data = ogg_sync_buffer (&oy, ret);
-      memcpy (data, readbuf, ret);
+      GNUNET_memcpy (data, readbuf, ret);
       ogg_sync_wrote (&oy, ret);
       ogg_demux_and_decode ();
     }