-man page for gnunet-conversation
[oweals/gnunet.git] / src / conversation / microphone.c
index 8e9b9e241320deb020f035c76f91c5590c5a04a6..2c399c74d54ab1b1b56a2b88e2085837470cdb73 100644 (file)
@@ -74,16 +74,17 @@ process_record_messages (void *cls,
                         const struct GNUNET_MessageHeader *msg)
 {
   struct Microphone *mic = cls;
+  const struct AudioMessage *am;
 
-  if ( (ntohs (msg->size) != sizeof (struct AudioMessage)) ||
-       (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO) )
+  if (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO)
   {
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
+  am = (const struct AudioMessage *) msg;
   mic->rdc (mic->rdc_cls,
-           sizeof (struct AudioMessage),
-           (const char *) msg);
+           ntohs (msg->size) - sizeof (struct AudioMessage),
+           &am[1]);
   return GNUNET_OK;
 }
 
@@ -101,11 +102,12 @@ enable (void *cls,
        void *rdc_cls)
 {
   struct Microphone *mic = cls;  
-  char * const record_helper_argv[] = 
+  static char * const record_helper_argv[] = 
   {
     "gnunet-helper-audio-record",
     NULL
   };
+
   mic->rdc = rdc;
   mic->rdc_cls = rdc_cls;
   mic->record_helper = GNUNET_HELPER_start (GNUNET_NO,