Avoid reallocating the decodedImage for every decoded frame.
Also made sure the right size is allocated. BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/240004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@790 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ee3dfa6f43
commit
2b0f094c8f
@ -1049,8 +1049,8 @@ VP8Decoder::ReturnFrame(const vpx_image_t* img, WebRtc_UWord32 timeStamp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allocate memory for decoded image
|
// Allocate memory for decoded image
|
||||||
WebRtc_UWord32 requiredSize = (3 * img->h * img->w) >> 1;
|
WebRtc_UWord32 requiredSize = (3 * img->d_h * img->d_w) >> 1;
|
||||||
if (_decodedImage._buffer != NULL)
|
if (requiredSize > _decodedImage._size)
|
||||||
{
|
{
|
||||||
delete [] _decodedImage._buffer;
|
delete [] _decodedImage._buffer;
|
||||||
_decodedImage._buffer = NULL;
|
_decodedImage._buffer = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user