- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a file that contains a raw MPEG-4 bitstream (.m4v) that I can successfully play with simple_player. I've written an MFC test app to play my file by assembling snippets from the UMC manual and bits and pieces found here on this forum (special thanks to franknatoli). However,Visual Studio 2008 reportsa heap corruption errorwhen I attempt to initialise my splitter.
The code for MPEG-4 decoding resides in a separate worker thread, and this thread is spawned when the main dialog window is about to be displayed in OnInitDialog(). The code is as follows:
[cpp]unsigned int CRenderM4VDlg::ThreadFunction() { unsigned int nResult= 0; TCHAR szFilename[MAX_PATH]= { _T("D:\Development\Code\C++\Mfc\RenderM4V\ella.m4v") }; CString str; UMC::Status umcResult; // Initialise file reader UMC::FIOReader reader; UMC::FileReaderParams readerParams; readerParams.m_portion_size= 0; vm_string_strcpy(readerParams.m_file_name, szFilename); umcResult= reader.Init(&readerParams); if (umcResult != UMC::UMC_OK) { str.Format(_T("FIOReader.Init failure %d"), umcResult); AfxMessageBox(str); return 0xFFFFFFFF; } // Create splitter UMC::Splitter *splitter; UMC::SystemStreamType streamType= UMC::Splitter::GetStreamType(&reader); // Identify input stream and instantiate appropriate splitter switch (streamType) { case UMC::MP4_ATOM_STREAM : splitter = (UMC::Splitter*)(new UMC::MP4Splitter()); break; case UMC::MPEGx_SYSTEM_STREAM : splitter = (UMC::Splitter*)(new UMC::ThreadedDemuxer()); // This splitter is used break; default : AfxMessageBox(_T("Splitter::GetStreamType unknown")); return 0xFFFFFFFF; } // Initialize splitter UMC::SplitterParams splitterParams; splitterParams.m_lFlags = UMC::VIDEO_SPLITTER; // Extract only video splitterParams.m_pDataReader = &reader; umcResult = splitter->Init(splitterParams);[/cpp]
After executing this final line VisualStudio pops up an error dialog reporting heap corruption.
Could someone please tell me what I've done wrong? I'm using VS2008 on Vista SP1.
Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a file that contains a raw MPEG-4 bitstream (.m4v) that I can successfully play with simple_player. I've written an MFC test app to play my file by assembling snippets from the UMC manual and bits and pieces found here on this forum (special thanks to franknatoli). However,Visual Studio 2008 reportsa heap corruption errorwhen I attempt to initialise my splitter.
The code for MPEG-4 decoding resides in a separate worker thread, and this thread is spawned when the main dialog window is about to be displayed in OnInitDialog(). The code is as follows:
[cpp]unsigned int CRenderM4VDlg::ThreadFunction() { unsigned int nResult= 0; TCHAR szFilename[MAX_PATH]= { _T("D:DevelopmentCodeC++MfcRenderM4Vella.m4v") }; CString str; UMC::Status umcResult; // Initialise file reader UMC::FIOReader reader; UMC::FileReaderParams readerParams; readerParams.m_portion_size= 0; vm_string_strcpy(readerParams.m_file_name, szFilename); umcResult= reader.Init(&readerParams); if (umcResult != UMC::UMC_OK) { str.Format(_T("FIOReader.Init failure %d"), umcResult); AfxMessageBox(str); return 0xFFFFFFFF; } // Create splitter UMC::Splitter *splitter; UMC::SystemStreamType streamType= UMC::Splitter::GetStreamType(&reader); // Identify input stream and instantiate appropriate splitter switch (streamType) { case UMC::MP4_ATOM_STREAM : splitter = (UMC::Splitter*)(new UMC::MP4Splitter()); break; case UMC::MPEGx_SYSTEM_STREAM : splitter = (UMC::Splitter*)(new UMC::ThreadedDemuxer()); // This splitter is used break; default : AfxMessageBox(_T("Splitter::GetStreamType unknown")); return 0xFFFFFFFF; } // Initialize splitter UMC::SplitterParams splitterParams; splitterParams.m_lFlags = UMC::VIDEO_SPLITTER; // Extract only video splitterParams.m_pDataReader = &reader; umcResult = splitter->Init(splitterParams);[/cpp]
After executing this final line VisualStudio pops up an error dialog reporting heap corruption.
Could someone please tell me what I've done wrong? I'm using VS2008 on Vista SP1.
Thanks in advance.
More information:I'm using IPP v5.3 Update 4. I successfully compiled the all the UMC libraries, executables etc.by using the build32.bat file. I'm running a Intel Pentium 4 CPU 3.20 GHz with 1 GB RAM.
Can anyone help?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page