[datatype-dev] Modification to CRIFFReader to make it find QCP file chunks correctly.
Umakant Gundeli ugundeli at real.comHi Eric, You are right. I figured out that CRIFFReader doesn't need any changes. I am dropping this CR. Please disregard this CR. Thanks, - Umakant. >-----Original Message----- >From: Eric Hyche [mailto:ehyche at real.com] >Sent: Monday, June 29, 2009 6:24 AM >To: ugundeli at real.com; datatype-dev at helixcommunity.org >Subject: RE: [datatype-dev] Modification to CRIFFReader to make it find QCP >file chunks correctly. > >I don't think we can make this change. QCP is not the only >file format that uses a "RIFF" identifier at the beginning. >The WAV file format, for instance uses the same "RIFF" identifier >at the beginning of the file. > >Are you saying that the QCP file format does not follow the >RIFF file format convention? > >Eric > >======================================= >Eric Hyche (ehyche at real.com) >Principal Engineer >RealNetworks, Inc. > > >>-----Original Message----- >>From: datatype-dev-bounces at helixcommunity.org [mailto:datatype-dev- >bounces at helixcommunity.org] On >>Behalf Of Umakant Gundeli >>Sent: Friday, June 26, 2009 3:19 PM >>To: datatype-dev at helixcommunity.org >>Subject: [datatype-dev] Modification to CRIFFReader to make it find QCP >file chunks correctly. >> >>Synopsis : Modification to CRIFFReader to make it find QCP file chunks >correctly. >> >> >> >>Overview : Unlike other RIFF based file formats, the QCP File starts with >"RIFF" identifier followed >>by riff-size which is total file size and NOT chunk size ! >> >>Thus, the current seeking logic seeks to end of QCP file and NOT to next >chunk. To avoid this, we need >>to seek by constant (i.e. 4) instead of riff-size. >> >> >> >> >> >>Files Modified : >> >>datatype/common/util/riff.cpp >> >> >> >>BIF Branch : HEAD >> >>Profile : helix-client-all-defines >> >> >> >>DIFF: >> >> >> >>Index: riff.cpp >> >>=================================================================== >> >>RCS file: /cvsroot/datatype/common/util/riff.cpp,v >> >>retrieving revision 1.16 >> >>diff -u -b -B -r1.16 riff.cpp >> >>--- riff.cpp 14 Nov 2008 21:46:28 -0000 1.16 >> >>+++ riff.cpp 26 Jun 2009 17:47:23 -0000 >> >>@@ -412,10 +412,23 @@ >> >> } >> >> else >> >> { >> >>+ >> >> // Didn't find it, go to the next chunk. >> >> m_state = RS_ChunkBodySeekPending; >> >>+ #define RIFF_CHUNK_ID 0x52494646 /* 'RIFF' */ >> >>+ if((UINT32)getlong(buf) == RIFF_CHUNK_ID) >> >>+ { >> >>+ //Unlike other RIFF based file formats, >> >>+ // the QCP File starts with "RIFF" >identifier followed >> >>+ // by riff-size which is total file >size and NOT chunk size ! >> >>+ // So, m_ulCurOffset+GetLong(&buf[4]) >seeks to end of file and NOT >>to next chunk >> >>+ // To Avoid this, We need to seek by 4 >instead of GetLong(&buf[4]) >> >>+ m_ulSeekOffset = m_ulCurOffset + 4; >> >>+ } >> >>+ else >> >>+ { >> >> m_ulSeekOffset = m_ulCurOffset + >GetLong(&buf[4]); >> >>+ } >> >> /* Are we at the end of .rm file */ >> >> if ( m_ulSeekOffset == m_ulCurOffset && >> >> m_ulFileType != RIFF_FILE_MAGIC_NUMBER && >> >> >> >>Thank you, >> >> >> >>- Umakant. >> >>