diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2011-11-22 04:12:41 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2011-11-22 04:12:41 +0400 |
commit | cf5bb633c2bc038454e8a17f51242760ec7471c4 (patch) | |
tree | 73776b8d3d5df617ca4d902157cff382e65af655 /src/filters/parser/MP4Splitter/MP4Splitter.cpp | |
parent | c45c78aa9010dbb3bb6bdf5aad35713c04f6daea (diff) |
Fix: MP4Splitter, incorrect parse video stream on old QuickTime MPEG4 files
Change: modify event on Mouse DBLClick
Fix: Cursor does not hide when it does not need to hide with multi-monitor configuration - patch by judelaw
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3847 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/MP4Splitter/MP4Splitter.cpp')
-rw-r--r-- | src/filters/parser/MP4Splitter/MP4Splitter.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp index ad6455c22..73b1dc643 100644 --- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp +++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp @@ -190,14 +190,28 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) di = ∅
}
+ LONG biWidth = (LONG)video_desc->GetWidth();
+ LONG biHeight = (LONG)video_desc->GetHeight();
+
+ if(!biWidth || !biHeight) {
+ if(AP4_TkhdAtom* tkhd = dynamic_cast<AP4_TkhdAtom*>(track->GetTrakAtom()->GetChild(AP4_ATOM_TYPE_TKHD))) {
+ biWidth = tkhd->GetWidth()>>16;
+ biHeight = tkhd->GetHeight()>>16;
+ }
+ }
+
+ if(!biWidth || !biHeight) {
+ continue;
+ }
+
mt.majortype = MEDIATYPE_Video;
mt.formattype = FORMAT_VideoInfo;
vih = (VIDEOINFOHEADER*)mt.AllocFormatBuffer(sizeof(VIDEOINFOHEADER) + di->GetDataSize());
memset(vih, 0, mt.FormatLength());
vih->dwBitRate = video_desc->GetAvgBitrate()/8;
vih->bmiHeader.biSize = sizeof(vih->bmiHeader);
- vih->bmiHeader.biWidth = (LONG)video_desc->GetWidth();
- vih->bmiHeader.biHeight = (LONG)video_desc->GetHeight();
+ vih->bmiHeader.biWidth = biWidth;
+ vih->bmiHeader.biHeight = biHeight;
memcpy(vih + 1, di->GetData(), di->GetDataSize());
switch(video_desc->GetObjectTypeId()) {
@@ -208,8 +222,8 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) MPEG2VIDEOINFO* vih = (MPEG2VIDEOINFO*)mt.AllocFormatBuffer(FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + di->GetDataSize());
memset(vih, 0, mt.FormatLength());
vih->hdr.bmiHeader.biSize = sizeof(vih->hdr.bmiHeader);
- vih->hdr.bmiHeader.biWidth = (LONG)video_desc->GetWidth();
- vih->hdr.bmiHeader.biHeight = (LONG)video_desc->GetHeight();
+ vih->hdr.bmiHeader.biWidth = biWidth;
+ vih->hdr.bmiHeader.biHeight = biHeight;
vih->hdr.bmiHeader.biCompression = 'v4pm';
vih->hdr.bmiHeader.biPlanes = 1;
vih->hdr.bmiHeader.biBitCount = 24;
|