Skip to content

Commit a7c9359

Browse files
committed
DVDFileInfo: Use aligned malloc for ffmpeg intrinsics
1 parent bda4a03 commit a7c9359

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

xbmc/cores/VideoPlayer/DVDFileInfo.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
#include <cstdlib>
5757
#include <memory>
5858

59+
#ifdef TARGET_POSIX
60+
#include "linux/XMemUtils.h"
61+
#endif
62+
5963
bool CDVDFileInfo::GetFileDuration(const std::string &path, int& duration)
6064
{
6165
std::unique_ptr<CDVDInputStream> input;
@@ -272,7 +276,7 @@ bool CDVDFileInfo::ExtractThumb(const std::string &strPath,
272276
aspect = hint.aspect;
273277
unsigned int nHeight = (unsigned int)((double)g_advancedSettings.m_imageRes / aspect);
274278

275-
uint8_t *pOutBuf = new uint8_t[nWidth * nHeight * 4];
279+
uint8_t *pOutBuf = (uint8_t*)_aligned_malloc(nWidth * nHeight * 4, 16);
276280
struct SwsContext *context = sws_getContext(picture.iWidth, picture.iHeight,
277281
AV_PIX_FMT_YUV420P, nWidth, nHeight, AV_PIX_FMT_BGRA, SWS_FAST_BILINEAR, NULL, NULL, NULL);
278282

@@ -291,8 +295,7 @@ bool CDVDFileInfo::ExtractThumb(const std::string &strPath,
291295
CPicture::CacheTexture(pOutBuf, nWidth, nHeight, nWidth * 4, orientation, nWidth, nHeight, CTextureCache::GetCachedPath(details.file));
292296
bOk = true;
293297
}
294-
295-
delete [] pOutBuf;
298+
_aligned_free(pOutBuf);
296299
}
297300
}
298301
else

0 commit comments

Comments
 (0)