[xiph-commits] r10449 - branches/oggdsf_new_demux/src/lib/codecs/cmml/dsfCMMLDecoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Fri Nov 25 21:12:52 PST 2005


Author: illiminable
Date: 2005-11-25 21:12:48 -0800 (Fri, 25 Nov 2005)
New Revision: 10449

Modified:
   branches/oggdsf_new_demux/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeInputPin.cpp
Log:
* Fix granule pos decoding for cmml

Modified: branches/oggdsf_new_demux/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeInputPin.cpp	2005-11-25 20:50:01 UTC (rev 10448)
+++ branches/oggdsf_new_demux/src/lib/codecs/cmml/dsfCMMLDecoder/CMMLDecodeInputPin.cpp	2005-11-26 05:12:48 UTC (rev 10449)
@@ -105,7 +105,10 @@
 LOOG_INT64 CMMLDecodeInputPin::convertGranuleToTime(LOOG_INT64 inGranule)
 {
 	//return inGranule * mVideoFormatBlock->AvgTimePerFrame;
-	return ((inGranule * mCMMLFormatBlock->granuleDenominator) / mCMMLFormatBlock->granuleNumerator);
+	LOOG_INT64 locMask = 0xffffffffffffffff >> (64 - mCMMLFormatBlock->granuleSplitBits);
+	LOOG_INT64 locTime = ((inGranule & locMask) + (inGranule >> mCMMLFormatBlock->granuleSplitBits));
+
+	return ((locTime * mCMMLFormatBlock->granuleDenominator * UNITS) / mCMMLFormatBlock->granuleNumerator);
 }
 
 LOOG_INT64 CMMLDecodeInputPin::mustSeekBefore(LOOG_INT64 inGranule)
@@ -155,7 +158,7 @@
 	delete mCMMLFormatBlock;
 	mCMMLFormatBlock = new sCMMLFormatBlock;
 	mCMMLFormatBlock->granuleNumerator = iLE_Math::CharArrToInt64(inHeaderPack->packetData() + 12);
-	mCMMLFormatBlock->granuleDenominator = iLE_Math::CharArrToInt64(inHeaderPack->packetData() + 16);
+	mCMMLFormatBlock->granuleDenominator = iLE_Math::CharArrToInt64(inHeaderPack->packetData() + 20);
 	mCMMLFormatBlock->granuleSplitBits = inHeaderPack->packetData()[28];
 	return true;
 	



More information about the commits mailing list