diff options
author | kinddragon <kinddragon@users.sourceforge.net> | 2010-05-26 05:56:33 +0400 |
---|---|---|
committer | kinddragon <kinddragon@users.sourceforge.net> | 2010-05-26 05:56:33 +0400 |
commit | 6da82c0172c33e8c23ab78f9f231096d7d53a8ae (patch) | |
tree | 08dc41bf9ea46bce106092bb06a3a8d4c778c742 /src/DSUtil | |
parent | 1260db21a3c9a3328a0dcb1da1dbbbfbfa056c39 (diff) |
Bug with PGS subtitles finally fixed (ticket #455)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1948 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/DSUtil')
-rw-r--r-- | src/DSUtil/DSUtil.cpp | 16 | ||||
-rw-r--r-- | src/DSUtil/DSUtil.h | 1 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp index aff89b0cc..845dad8a7 100644 --- a/src/DSUtil/DSUtil.cpp +++ b/src/DSUtil/DSUtil.cpp @@ -992,14 +992,24 @@ void memsetd(void* dst, unsigned int c, size_t nbytes) switch(n - o)
{
case 3:
- ((DWORD*)dst)[n + 2] = c;
+ ((DWORD*)dst)[o + 2] = c;
case 2:
- ((DWORD*)dst)[n + 1] = c;
+ ((DWORD*)dst)[o + 1] = c;
case 1:
- ((DWORD*)dst)[n + 0] = c;
+ ((DWORD*)dst)[o + 0] = c;
}
}
+void memsetw(void* dst, unsigned short c, size_t nbytes)
+{
+ memsetd(dst, c << 16 | c, nbytes);
+
+ size_t n = nbytes / 2;
+ size_t o = (n / 2) * 2;
+ if ((n - o) == 1)
+ ((WORD*)dst)[o] = c;
+}
+
bool ExtractBIH(const AM_MEDIA_TYPE* pmt, BITMAPINFOHEADER* bih)
{
if(pmt && bih)
diff --git a/src/DSUtil/DSUtil.h b/src/DSUtil/DSUtil.h index eb9cde17e..aa439cafa 100644 --- a/src/DSUtil/DSUtil.h +++ b/src/DSUtil/DSUtil.h @@ -71,6 +71,7 @@ extern bool GetKeyFrames(CString fn, CUIntArray& kfs); extern DVD_HMSF_TIMECODE RT2HMSF(REFERENCE_TIME rt, double fps = 0);
extern REFERENCE_TIME HMSF2RT(DVD_HMSF_TIMECODE hmsf, double fps = 0);
extern void memsetd(void* dst, unsigned int c, size_t nbytes);
+extern void memsetw(void* dst, unsigned short c, size_t nbytes);
extern bool ExtractBIH(const AM_MEDIA_TYPE* pmt, BITMAPINFOHEADER* bih);
extern bool ExtractBIH(IMediaSample* pMS, BITMAPINFOHEADER* bih);
extern bool ExtractAvgTimePerFrame(const AM_MEDIA_TYPE* pmt, REFERENCE_TIME& rtAvgTimePerFrame);
|