[xiph-commits] r11851 - trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sat Sep 23 03:08:53 PDT 2006


Author: illiminable
Date: 2006-09-23 03:08:49 -0700 (Sat, 23 Sep 2006)
New Revision: 11851

Modified:
   trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp
   trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.cpp
Log:
* Treat grsanules on ogm subtitle pages as start times instead of end times. Subtitles now display for correct amount of time.

Modified: trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp	2006-09-23 08:52:36 UTC (rev 11850)
+++ trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeFilter.cpp	2006-09-23 10:08:49 UTC (rev 11851)
@@ -248,6 +248,7 @@
 				locPackTime |= ((__int64)locInBuff[1+i] << (i * 8));
 			}
 		} else {
+            //TODO::: There's a default length field
 			locPackTime = 1;
 		}
 		
@@ -266,9 +267,17 @@
 			//__int64 locFrameDuration = mInputPin->getVideoFormatBlock()->AvgTimePerFrame;		//VS:::
 			__int64 locNumBuffered = mPacketBuffer.size();
 
-			locGlobalEnd = mInputPin->convertGranuleToTime(locEnd); //locEnd * locFrameDuration;											//VS:::
-			locGlobalStart = locGlobalEnd - (mInputPin->convertGranuleToTime(mOGMGranulesBuffered));//locGlobalEnd - (mOGMGranulesBuffered * locFrameDuration);				//VS:::
+            if (mInputPin->getOGMMediaType() == OGMDecodeInputPin::OGM_TEXT_TYPE) {
+                //An ogg end/page time in the discontinuous codec is a start time
+                locGlobalStart = mInputPin->convertGranuleToTime(locEnd);
+                locGlobalEnd = locGlobalStart + (mInputPin->convertGranuleToTime(mOGMGranulesBuffered));
+            } else {
+    			locGlobalEnd = mInputPin->convertGranuleToTime(locEnd); //locEnd * locFrameDuration;											//VS:::
+    			locGlobalStart = locGlobalEnd - (mInputPin->convertGranuleToTime(mOGMGranulesBuffered));//locGlobalEnd - (mOGMGranulesBuffered * locFrameDuration);				//VS:::
 
+            }
+
+
 			__int64 locUptoStart = locGlobalStart;
 			__int64 locUptoEnd = locGlobalStart;
 

Modified: trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.cpp	2006-09-23 08:52:36 UTC (rev 11850)
+++ trunk/oggdsf/src/lib/codecs/ogm/filters/dsfOGMDecoder/OGMDecodeInputPin.cpp	2006-09-23 10:08:49 UTC (rev 11851)
@@ -133,7 +133,20 @@
 LOOG_INT64 OGMDecodeInputPin::mustSeekBefore(LOOG_INT64 inGranule)
 {
 	//TODO::: Get adjustment from block size info... for now, it doesn't matter if no preroll
-	return inGranule;
+
+    return inGranule;
+
+ //   LOOG_INT64 locTempGranule = 0;
+	//switch (mOGMMediaType) {
+	//	case OGM_VIDEO_TYPE:
+	//		locTempGranule = inGranule - 64;
+ //           return (locTempGranule <= 0) ? 0 : locTempGranule;
+	//	case OGM_AUDIO_TYPE:
+	//	case OGM_TEXT_TYPE:
+	//	default:
+	//		return inGranule;
+ //   };
+
 }
 IOggDecoder::eAcceptHeaderResult OGMDecodeInputPin::showHeaderPacket(OggPacket* inCodecHeaderPacket)
 {



More information about the commits mailing list