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:
parent
16d78bd307
commit
3942f3a985
@ -200,17 +200,12 @@ int WebRtcNetEQ_DSPInit(DSPInst_t *inst, uint16_t fs)
|
|||||||
int16_t saveMsPerCall = inst->millisecondsPerCall;
|
int16_t saveMsPerCall = inst->millisecondsPerCall;
|
||||||
enum BGNMode saveBgnMode = inst->BGNInst.bgnMode;
|
enum BGNMode saveBgnMode = inst->BGNInst.bgnMode;
|
||||||
#ifdef NETEQ_STEREO
|
#ifdef NETEQ_STEREO
|
||||||
MasterSlaveInfo saveMSinfo;
|
MasterSlaveInfo* saveMSinfo = inst->msInfo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* copy contents of statInst to avoid clearing */WEBRTC_SPL_MEMCPY_W16(&saveStats, &(inst->statInst),
|
/* copy contents of statInst to avoid clearing */WEBRTC_SPL_MEMCPY_W16(&saveStats, &(inst->statInst),
|
||||||
sizeof(DSPStats_t)/sizeof(int16_t));
|
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 */
|
/* check that the sample rate is valid */
|
||||||
if ((fs != 8000)
|
if ((fs != 8000)
|
||||||
#ifdef NETEQ_WIDEBAND
|
#ifdef NETEQ_WIDEBAND
|
||||||
@ -292,8 +287,8 @@ int WebRtcNetEQ_DSPInit(DSPInst_t *inst, uint16_t fs)
|
|||||||
sizeof(DSPStats_t)/sizeof(int16_t));
|
sizeof(DSPStats_t)/sizeof(int16_t));
|
||||||
|
|
||||||
#ifdef NETEQ_STEREO
|
#ifdef NETEQ_STEREO
|
||||||
/* Recreate MSinfo */WEBRTC_SPL_MEMCPY_W16(&(inst->msInfo), &saveMSinfo,
|
/* Write back the pointer. */
|
||||||
sizeof(MasterSlaveInfo)/sizeof(int16_t));
|
inst->msInfo = saveMSinfo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NETEQ_CNG_CODEC
|
#ifdef NETEQ_CNG_CODEC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user