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;
}
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,