From: absolute on 13 Jan 2010 06:57 When I query the length of a large .wav file( larger than 2G,about 46 hours), mciSendCommand return the wrong value. My code is as below: MCI_SET_PARMS mciSetParms; mciSetParms.dwTimeFormat = MCI_FORMAT_SAMPLES; if(m_ErrorCode = mciSendCommand(m_wDeviceID,MCI_SET,MCI_WAIT| MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms)) { return false; } MCI_STATUS_PARMS mciStatusParms; mciStatusParms.dwItem = MCI_STATUS_LENGTH; if(m_ErrorCode = mciSendCommand(m_wDeviceID, MCI_STATUS,MCI_STATUS_ITEM, (DWORD)(LPVOID) &mciStatusParms)) { return false; } I suppose the return value of mciStatusParms.dwReturn should be 1231253424, but actually,it returned 3378737072. However, when the file is smaller than 2G, there is no problem. So, I think maybe it is a bug . Can anybody tell me is there a bug in mciSendCommand ? Thank you very much.
From: David Lowndes on 13 Jan 2010 07:13 >I suppose the return value of mciStatusParms.dwReturn should be >1231253424, but actually,it returned 3378737072. I know nothing about the mci APIs but if you convert those values to hex you can probably see what's happened. It looks like something has sign extended a value inappropriately? Dave
From: absolute on 13 Jan 2010 07:36 > I know nothing about the mci APIs but if you convert those values to > hex you can probably see what's happened. It looks like something has > sign extended a value inappropriately? > > Dave Yes, I see. The two results are just different between the sign bit. But the result is returned by the mciSendCommand API function. I debug and find the problem. So I think it is a bug. But I am not so sure. PS: Again, I did a experiment using a 1.8G file and a 2.2G file. The result returned by 1.8G file is correct, but result of 2.2G file is wrong.
From: David Lowndes on 13 Jan 2010 09:15 >Yes, I see. The two results are just different between the sign bit. Yes. >PS: Again, I did a experiment using a 1.8G file and a 2.2G file. The >result returned by 1.8G file is correct, but result of 2.2G file is >wrong. Assuming 1024 units... 2G = 2,147,483,648 = 0x80000000 What are the absolute file sizes and the figures you get? Dave
From: Alexander Grigoriev on 13 Jan 2010 10:27 MCI API and codes were designed in the era of 200 MB discs. I suspect it was never tested with large files, thus it has all kinds of integer overflow bugs. "absolute" <cool8511(a)gmail.com> wrote in message news:9eb70c3b-0a11-4bc1-87ff-c54df4910915(a)34g2000yqp.googlegroups.com... > When I query the length of a large .wav file( larger than 2G,about 46 > hours), mciSendCommand return the wrong value. > My code is as below: > > MCI_SET_PARMS mciSetParms; > mciSetParms.dwTimeFormat = MCI_FORMAT_SAMPLES; > if(m_ErrorCode = mciSendCommand(m_wDeviceID,MCI_SET,MCI_WAIT| > MCI_SET_TIME_FORMAT, > (DWORD)(LPVOID) &mciSetParms)) > { > return false; > } > MCI_STATUS_PARMS mciStatusParms; > mciStatusParms.dwItem = MCI_STATUS_LENGTH; > > if(m_ErrorCode = mciSendCommand(m_wDeviceID, > MCI_STATUS,MCI_STATUS_ITEM, > (DWORD)(LPVOID) &mciStatusParms)) > { > return false; > } > > I suppose the return value of mciStatusParms.dwReturn should be > 1231253424, but actually,it returned 3378737072. > However, when the file is smaller than 2G, there is no problem. > So, I think maybe it is a bug . > Can anybody tell me is there a bug in mciSendCommand ? > Thank you very much.
|
Next
|
Last
Pages: 1 2 3 Prev: How to implement CImageList::DrawIndirect in MFC 4.2? Next: Why is network reading slow? |