From: Pooya K. <po...@us...> - 2006-08-02 13:51:33
|
Update of /cvsroot/playerstage/code/stage/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2865/src Modified Files: model_audio.c p_audio.cc Log Message: fixed msg packet size for audio data Index: p_audio.cc =================================================================== RCS file: /cvsroot/playerstage/code/stage/src/p_audio.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** p_audio.cc 27 Jul 2006 22:42:24 -0000 1.2 --- p_audio.cc 2 Aug 2006 20:51:27 -0000 1.3 *************** *** 30,36 **** #include "p_driver.h" ! typedef struct { ! char string[STG_AUDIO_MAX_STRING_LEN]; ! } audio_msg_t; /** @addtogroup player --- 30,35 ---- #include "p_driver.h" ! typedef char audio_msg_t[STG_AUDIO_MAX_STRING_LEN]; ! /** @addtogroup player *************** *** 63,72 **** // Translate the Stage-formatted sdata into the Player-formatted pdata ! audio_msg_t *audioMsgStruct; ! pdata.data_count = sizeof(audio_msg_t); ! audioMsgStruct = reinterpret_cast < audio_msg_t * >(pdata.data); - sprintf(audioMsgStruct->string, "%s", sdata->recv); - // clear received message once sent to the client sdata->recv[0]=0; --- 62,73 ---- // Translate the Stage-formatted sdata into the Player-formatted pdata ! audio_msg_t *audio_msg; ! // pdata.data_count = sizeof(audio_msg_t); ! pdata.data_count = strlen(sdata->recv)+1; ! audio_msg = reinterpret_cast < audio_msg_t * >(pdata.data); ! ! //sprintf(audioMsgStruct, "%s", sdata->recv); ! strncpy((char *)audio_msg, sdata->recv, STG_AUDIO_MAX_STRING_LEN); // clear received message once sent to the client sdata->recv[0]=0; Index: model_audio.c =================================================================== RCS file: /cvsroot/playerstage/code/stage/src/model_audio.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** model_audio.c 1 Aug 2006 04:20:49 -0000 1.4 --- model_audio.c 2 Aug 2006 20:51:27 -0000 1.5 *************** *** 1129,1133 **** data->string); ! sprintf(trg_data->recv, "%s,%5.2f,%5.2f,%s", mod->token, dists[i], recvangle, data->string); //TODO: call model_change?! --- 1129,1134 ---- data->string); ! snprintf(trg_data->recv, STG_AUDIO_MAX_STRING_LEN, ! "%s,%5.2f,%5.2f,%s", mod->token, dists[i], recvangle, data->string); //TODO: call model_change?! |