Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkinddragon <kinddragon@users.sourceforge.net>2010-05-29 01:52:48 +0400
committerkinddragon <kinddragon@users.sourceforge.net>2010-05-29 01:52:48 +0400
commitbcfb2e624297f659a5bcf28ae745c89b5d955f31 (patch)
treecc6ccaab360972b8c2d4cd3ce4c2ea9637998016
parent1d2de6a8709b87bcb095f6addd9254a3caf326a5 (diff)
AP4_Track::GetTrackName fixed after update MPEG4 Splitter (ticket #499)
We now call "Navigate forward" when graph building error appear Quicktime bitmap lines now aligned More general VDFastMemcpyPartialSSE2 implantation git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1976 10f7b99b-c216-0410-bff0-8a66a9350fd8
-rw-r--r--src/apps/mplayerc/MainFrm.cpp23
-rw-r--r--src/apps/mplayerc/QuicktimeGraph.cpp8
-rw-r--r--src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.cpp10
-rw-r--r--src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.h4
-rw-r--r--src/filters/parser/MP4Splitter/MP4Splitter.cpp4
-rw-r--r--src/thirdparty/VirtualDub/system/source/a_memory.asm114
-rw-r--r--src/thirdparty/VirtualDub/system/source/memory.cpp24
7 files changed, 91 insertions, 96 deletions
diff --git a/src/apps/mplayerc/MainFrm.cpp b/src/apps/mplayerc/MainFrm.cpp
index d36e9e44b..37163eb6c 100644
--- a/src/apps/mplayerc/MainFrm.cpp
+++ b/src/apps/mplayerc/MainFrm.cpp
@@ -11089,23 +11089,12 @@ bool CMainFrame::OpenMediaPrivate(CAutoPtr<OpenMediaData> pOMD)
CloseMediaPrivate();
m_closingmsg = err;
- OpenFileData* p = dynamic_cast<OpenFileData*>(pOMD.m_p);
- if(p && err != aborted)
- {
- m_wndPlaylistBar.SetCurValid(false);
- if(m_wndPlaylistBar.GetCount() > 1)
- {
- CPlaylistItem pli[2];
- m_wndPlaylistBar.GetCur(pli[0]);
- m_wndPlaylistBar.SetNext();
- m_wndPlaylistBar.GetCur(pli[1]);
- if(pli[0].m_id != pli[1].m_id)
- {
- CAutoPtr<OpenMediaData> p(m_wndPlaylistBar.GetCurOMD());
- if(p) OpenMediaPrivate(p);
- }
- }
- }
+ if(err != aborted)
+ {
+ if(pFileData)
+ m_wndPlaylistBar.SetCurValid(false);
+ OnNavigateSkip(ID_NAVIGATE_SKIPFORWARD);
+ }
}
else
{
diff --git a/src/apps/mplayerc/QuicktimeGraph.cpp b/src/apps/mplayerc/QuicktimeGraph.cpp
index 81cc3d021..0f7c36e26 100644
--- a/src/apps/mplayerc/QuicktimeGraph.cpp
+++ b/src/apps/mplayerc/QuicktimeGraph.cpp
@@ -415,7 +415,8 @@ OSErr CQuicktimeWindow::MyMovieDrawingCompleteProc(Movie theMovie, long refCon)
if(CComQIPtr<IQTVideoSurface> pQTVS = (IUnknown*)(INonDelegatingUnknown*)pGraph)
{
BITMAP bm;
- pQW->m_bm.GetObject(sizeof(bm), &bm);
+ pQW->m_bm.GetObject(sizeof(bm), &bm);
+ bm.bmWidth = pQW->m_size.cx;
pQTVS->DoBlt(bm);
}
/*
@@ -516,10 +517,10 @@ bool CQuicktimeWindow::OpenMovie(CString fn)
memset(&bmi, 0, sizeof(bmi));
//int bpp = m_dc.GetDeviceCaps(BITSPIXEL);
-
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biCompression = BI_BITFIELDS/*BI_RGB*/;
- bmi.bmiHeader.biWidth = m_size.cx;
+ LONG pitch = (m_size.cx + 0xF) & ~0xF;
+ bmi.bmiHeader.biWidth = pitch;
bmi.bmiHeader.biHeight = -m_size.cy;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32/*bpp*/;
@@ -538,6 +539,7 @@ bool CQuicktimeWindow::OpenMovie(CString fn)
BITMAP bm;
m_bm.GetObject(sizeof(bm), &bm);
+ bm.bmWidth = m_size.cx;
pQTVS->BeginBlt(bm);
}
}
diff --git a/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.cpp b/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.cpp
index 7748c71a8..9dc915571 100644
--- a/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.cpp
+++ b/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.cpp
@@ -215,7 +215,7 @@ AP4_Track::Clone(AP4_Result* result)
GetDuration(),
GetMediaTimeScale(),
GetMediaDuration(),
- GetTrackLanguage(),
+ GetTrackLanguage().GetChars(),
GetWidth(),
GetHeight());
@@ -449,11 +449,11 @@ AP4_Track::GetMediaDuration()
/*----------------------------------------------------------------------
| AP4_Track::GetTrackName
+---------------------------------------------------------------------*/
-const char*
+const AP4_String
AP4_Track::GetTrackName()
{
if (AP4_HdlrAtom* hdlr = AP4_DYNAMIC_CAST(AP4_HdlrAtom, m_TrakAtom->FindChild("mdia/hdlr"))) {
- return hdlr->GetHandlerName().GetChars();
+ return hdlr->GetHandlerName();
}
return NULL;
}
@@ -461,11 +461,11 @@ AP4_Track::GetTrackName()
/*----------------------------------------------------------------------
| AP4_Track::GetTrackLanguage
+---------------------------------------------------------------------*/
-const char*
+const AP4_String
AP4_Track::GetTrackLanguage()
{
if (AP4_MdhdAtom* mdhd = AP4_DYNAMIC_CAST(AP4_MdhdAtom, m_TrakAtom->FindChild("mdia/mdhd"))) {
- return mdhd->GetLanguage().GetChars();
+ return mdhd->GetLanguage();
}
return NULL;
}
diff --git a/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.h b/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.h
index 4c6588e53..12b48560c 100644
--- a/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.h
+++ b/src/filters/parser/MP4Splitter/AP4/Source/Core/Ap4Track.h
@@ -128,8 +128,8 @@ class AP4_Track {
AP4_UI32 GetMovieTimeScale() { return m_MovieTimeScale; }
AP4_UI32 GetMediaTimeScale();
AP4_UI64 GetMediaDuration(); // in the timescale of the media
- const char* GetTrackName();
- const char* GetTrackLanguage();
+ const AP4_String GetTrackName();
+ const AP4_String GetTrackLanguage();
AP4_Result Attach(AP4_MoovAtom* moov);
protected:
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
index 7b6718f8f..87e18e851 100644
--- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp
+++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
@@ -166,8 +166,8 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
if(!AP4_SUCCEEDED(track->GetSample(0, sample)) || sample.GetDescriptionIndex() == 0xFFFFFFFF)
continue;
- CStringW TrackName = UTF8To16(track->GetTrackName());
- CStringA TrackLanguage = track->GetTrackLanguage();
+ CStringW TrackName = UTF8To16(track->GetTrackName().GetChars());
+ CStringA TrackLanguage = track->GetTrackLanguage().GetChars();
CAtlArray<CMediaType> mts;
diff --git a/src/thirdparty/VirtualDub/system/source/a_memory.asm b/src/thirdparty/VirtualDub/system/source/a_memory.asm
index 42a8ca998..d2316e55a 100644
--- a/src/thirdparty/VirtualDub/system/source/a_memory.asm
+++ b/src/thirdparty/VirtualDub/system/source/a_memory.asm
@@ -71,6 +71,65 @@ _VDFastMemcpyPartialMMX:
pop edi
ret
+ global _VDFastMemcpyPartialSSE2
+_VDFastMemcpyPartialSSE2:
+ push ebp
+ push edi
+ push esi
+ push ebx
+
+ mov ecx, [esp+12+16]
+ cmp ecx, 128
+ jb _VDFastMemcpyPartialMMX2.MMX2
+ mov edi, [esp+4+16]
+ mov esi, [esp+8+16]
+ mov eax, edi
+ or eax, esi
+ test al, 15
+ jne SHORT _VDFastMemcpyPartialMMX2.MMX2
+
+ shr ecx, 7
+.loop128:
+ prefetchnta [esi+16*8]
+ movaps xmm0, [esi]
+ movaps xmm1, [esi+16*1]
+ movaps xmm2, [esi+16*2]
+ movaps xmm3, [esi+16*3]
+ movaps xmm4, [esi+16*4]
+ movaps xmm5, [esi+16*5]
+ movaps xmm6, [esi+16*6]
+ movaps xmm7, [esi+16*7]
+ movntps [edi], xmm0
+ movntps [edi+16*1], xmm1
+ movntps [edi+16*2], xmm2
+ movntps [edi+16*3], xmm3
+ movntps [edi+16*4], xmm4
+ movntps [edi+16*5], xmm5
+ movntps [edi+16*6], xmm6
+ movntps [edi+16*7], xmm7
+ add esi, 128
+ add edi, 128
+ dec ecx
+ jne .loop128
+.skiploop128:
+ mov ecx, [esp+12+16]
+ and ecx, 127
+ cmp ecx, 0
+ je .nooddballs
+.loop:
+ mov dl, [esi]
+ mov [edi], dl
+ inc esi
+ inc edi
+ dec ecx
+ jne .loop
+.nooddballs:
+ pop ebx
+ pop esi
+ pop edi
+ pop ebp
+ ret
+
global _VDFastMemcpyPartialMMX2
_VDFastMemcpyPartialMMX2:
push ebp
@@ -78,6 +137,7 @@ _VDFastMemcpyPartialMMX2:
push esi
push ebx
+.MMX2
mov ebx, [esp+4+16]
mov edx, [esp+8+16]
mov eax, [esp+12+16]
@@ -130,60 +190,6 @@ _VDFastMemcpyPartialMMX2:
pop ebp
ret
- global _VDFastMemcpyPartialSSE2
-_VDFastMemcpyPartialSSE2:
- push ebp
- push edi
- push esi
- push ebx
-
- mov edi, [esp+4+16]
- mov esi, [esp+8+16]
- mov ecx, [esp+12+16]
- shr ecx, 7
- cmp ecx, 0
- jbe .skipblastloop
-.blastloop:
- prefetchnta [esi+16*8]
- movaps xmm0, [esi]
- movaps xmm1, [esi+16*1]
- movaps xmm2, [esi+16*2]
- movaps xmm3, [esi+16*3]
- movaps xmm4, [esi+16*4]
- movaps xmm5, [esi+16*5]
- movaps xmm6, [esi+16*6]
- movaps xmm7, [esi+16*7]
- movntps [edi], xmm0
- movntps [edi+16*1], xmm1
- movntps [edi+16*2], xmm2
- movntps [edi+16*3], xmm3
- movntps [edi+16*4], xmm4
- movntps [edi+16*5], xmm5
- movntps [edi+16*6], xmm6
- movntps [edi+16*7], xmm7
- add esi, 128
- add edi, 128
- dec ecx
- jne .blastloop
-.skipblastloop:
- mov ecx, [esp+12+16]
- and ecx, 127
- cmp ecx, 0
- je .nooddballs
-.loop:
- mov dl, [esi]
- mov [edi], dl
- inc esi
- inc edi
- dec ecx
- jne .loop
-.nooddballs:
- pop ebx
- pop esi
- pop edi
- pop ebp
- ret
-
end
diff --git a/src/thirdparty/VirtualDub/system/source/memory.cpp b/src/thirdparty/VirtualDub/system/source/memory.cpp
index 5ba295427..abc394e9a 100644
--- a/src/thirdparty/VirtualDub/system/source/memory.cpp
+++ b/src/thirdparty/VirtualDub/system/source/memory.cpp
@@ -392,7 +392,14 @@ void VDMemset32Rect(void *dst, ptrdiff_t pitch, uint32 value, size_t w, size_t h
void VDFastMemcpyAutodetect() {
long exts = CPUGetEnabledExtensions();
- if (exts & CPUF_SUPPORTS_SSE) {
+ // MPC custom code (begin)
+ if (exts & CPUF_SUPPORTS_SSE2) {
+ VDFastMemcpyPartial = VDFastMemcpyPartialSSE2;
+ VDFastMemcpyFinish = VDFastMemcpyFinishMMX2;
+ VDSwapMemory = VDSwapMemorySSE;
+ }
+ // MPC custom code (end)
+ else if (exts & CPUF_SUPPORTS_SSE) {
VDFastMemcpyPartial = VDFastMemcpyPartialMMX2;
VDFastMemcpyFinish = VDFastMemcpyFinishMMX2;
VDSwapMemory = VDSwapMemorySSE;
@@ -427,27 +434,18 @@ void VDMemcpyRect(void *dst, ptrdiff_t dststride, const void *src, ptrdiff_t src
if (w <= 0 || h <= 0)
return;
- void (__cdecl *VDFastMemcpyPartial_)(void *dst, const void *src, size_t bytes) = VDFastMemcpyPartial;
- // MPC custom code (begin)
-#if defined(_WIN32) && defined(_M_IX86)
- if ((CPUGetEnabledExtensions() & CPUF_SUPPORTS_SSE2) &&
- !(((UINT_PTR)dst | dststride | (UINT_PTR)src | srcstride) & 0xF))
- VDFastMemcpyPartial_ = VDFastMemcpyPartialSSE2;
-#endif
- // MPC custom code (end)
-
if (w == srcstride && w == dststride)
- VDFastMemcpyPartial_(dst, src, w*h);
+ VDFastMemcpyPartial(dst, src, w*h);
// MPC custom code (begin)
else if (w == -srcstride && w == -dststride)
- VDFastMemcpyPartial_((char *)dst + dststride * (h - 1), (char *)src + srcstride * (h - 1), w*h);
+ VDFastMemcpyPartial((char *)dst + dststride * (h - 1), (char *)src + srcstride * (h - 1), w*h);
// MPC custom code (end)
else {
char *dst2 = (char *)dst;
const char *src2 = (const char *)src;
do {
- VDFastMemcpyPartial_(dst2, src2, w);
+ VDFastMemcpyPartial(dst2, src2, w);
dst2 += dststride;
src2 += srcstride;
} while(--h);