diff options
author | OctaneSnail <os@v12pwr.com> | 2008-12-13 21:54:51 +0300 |
---|---|---|
committer | OctaneSnail <os@v12pwr.com> | 2008-12-13 22:54:08 +0300 |
commit | 0978b5dd252cfdfed9813af201d634aa9e79d949 (patch) | |
tree | 9b1e7b457c1ddca08146682a7a2f1502d836deae /OutputPin.cpp | |
parent | 75ed77126304e38d098fc4f5845e552a48999734 (diff) |
Fix handling of archives and media files larger than 4 gigabytes.
Based on a patch from OV2.
Diffstat (limited to 'OutputPin.cpp')
-rw-r--r-- | OutputPin.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/OutputPin.cpp b/OutputPin.cpp index acee509..4090a52 100644 --- a/OutputPin.cpp +++ b/OutputPin.cpp @@ -275,7 +275,8 @@ STDMETHODIMP CRFSOutputPin::Request (IMediaSample* pSample, DWORD_PTR dwUser) } LARGE_INTEGER offset; - DWORD to_read, acc = 0, offset2; + DWORD to_read, acc = 0; + LONGLONG offset2; int pos = FindStartPart (llPosition); if (pos == -1) @@ -294,7 +295,7 @@ STDMETHODIMP CRFSOutputPin::Request (IMediaSample* pSample, DWORD_PTR dwUser) FilePart *part = m_file->array + pos; - offset2 = (DWORD) (llPosition - part->in_file_offset); + offset2 = llPosition - part->in_file_offset; offset.QuadPart = part->in_rar_offset + offset2; while (true) @@ -310,7 +311,7 @@ STDMETHODIMP CRFSOutputPin::Request (IMediaSample* pSample, DWORD_PTR dwUser) request->subreqs.InsertLast (sr); request->count ++; - to_read = min (lLength, part->size - offset2); + to_read = min (lLength, (DWORD) (part->size - offset2)); sr->file = part->file; sr->expected = to_read; @@ -552,7 +553,8 @@ HRESULT CRFSOutputPin::SyncRead (LONGLONG llPosition, DWORD lLength, BYTE* pBuff { OVERLAPPED o; LARGE_INTEGER offset; - DWORD to_read, read, acc = 0, offset2; + DWORD to_read, read, acc = 0; + LONGLONG offset2; int pos; #ifdef _DEBUG static int last_pos = -1; @@ -583,7 +585,7 @@ HRESULT CRFSOutputPin::SyncRead (LONGLONG llPosition, DWORD lLength, BYTE* pBuff #endif FilePart *part = m_file->array + pos; - offset2 = (DWORD) (llPosition - part->in_file_offset); + offset2 = llPosition - part->in_file_offset; offset.QuadPart = part->in_rar_offset + offset2; memset (&o, 0, sizeof (o)); @@ -597,7 +599,7 @@ HRESULT CRFSOutputPin::SyncRead (LONGLONG llPosition, DWORD lLength, BYTE* pBuff while (true) { read = 0; - to_read = min (lLength, part->size - offset2); + to_read = min (lLength, (DWORD) (part->size - offset2)); o.Offset = offset.LowPart; o.OffsetHigh = offset.HighPart; |