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:
stefan@webrtc.org 2011-10-21 06:39:03 +00:00
parent ee3dfa6f43
commit 2b0f094c8f

View File

@ -1049,8 +1049,8 @@ VP8Decoder::ReturnFrame(const vpx_image_t* img, WebRtc_UWord32 timeStamp)
}
// Allocate memory for decoded image
WebRtc_UWord32 requiredSize = (3 * img->h * img->w) >> 1;
if (_decodedImage._buffer != NULL)
WebRtc_UWord32 requiredSize = (3 * img->d_h * img->d_w) >> 1;
if (requiredSize > _decodedImage._size)
{
delete [] _decodedImage._buffer;
_decodedImage._buffer = NULL;