Issue 1847, memcopy is wrong and unnecessary, it is sufficient to store the pointer before clearing the instance, and write back the pointer.

bug=issue1847

R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1585006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4178 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org 2013-06-04 21:31:22 +00:00
parent 16d78bd307
commit 3942f3a985

View File

@ -200,17 +200,12 @@ int WebRtcNetEQ_DSPInit(DSPInst_t *inst, uint16_t fs)
int16_t saveMsPerCall = inst->millisecondsPerCall;
enum BGNMode saveBgnMode = inst->BGNInst.bgnMode;
#ifdef NETEQ_STEREO
MasterSlaveInfo saveMSinfo;
MasterSlaveInfo* saveMSinfo = inst->msInfo;
#endif
/* copy contents of statInst to avoid clearing */WEBRTC_SPL_MEMCPY_W16(&saveStats, &(inst->statInst),
sizeof(DSPStats_t)/sizeof(int16_t));
#ifdef NETEQ_STEREO
/* copy contents of msInfo to avoid clearing */WEBRTC_SPL_MEMCPY_W16(&saveMSinfo, &(inst->msInfo),
sizeof(MasterSlaveInfo)/sizeof(int16_t));
#endif
/* check that the sample rate is valid */
if ((fs != 8000)
#ifdef NETEQ_WIDEBAND
@ -292,8 +287,8 @@ int WebRtcNetEQ_DSPInit(DSPInst_t *inst, uint16_t fs)
sizeof(DSPStats_t)/sizeof(int16_t));
#ifdef NETEQ_STEREO
/* Recreate MSinfo */WEBRTC_SPL_MEMCPY_W16(&(inst->msInfo), &saveMSinfo,
sizeof(MasterSlaveInfo)/sizeof(int16_t));
/* Write back the pointer. */
inst->msInfo = saveMSinfo;
#endif
#ifdef NETEQ_CNG_CODEC