[xiph-commits] r10261 -
branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg
illiminable at svn.xiph.org
illiminable at svn.xiph.org
Sun Oct 23 00:59:08 PDT 2005
Author: illiminable
Date: 2005-10-23 00:59:04 -0700 (Sun, 23 Oct 2005)
New Revision: 10261
Modified:
branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp
branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.h
branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPage.cpp
Log:
* Change the packetiser to go back to providing no time information about other packets. No longer sets time stamps on any other packets
Modified: branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp 2005-10-23 07:44:42 UTC (rev 10260)
+++ branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp 2005-10-23 07:59:04 UTC (rev 10261)
@@ -37,8 +37,8 @@
, mPacketiserState(PKRSTATE_OK)
, mLooseMode(true) //FIX::: This affects the validator.
, mNumIgnorePackets(0)
- , mPrevGranPos(0)
- , mCurrentGranPos(0)
+ //, mPrevGranPos(0)
+ //, mCurrentGranPos(0)
{
//debugLog.open("g:\\logs\\packetise.log", ios_base::out);
@@ -49,8 +49,8 @@
, mPacketiserState(PKRSTATE_OK)
, mLooseMode(true) //FIX::: This affects the validator.
, mNumIgnorePackets(0)
- , mPrevGranPos(0)
- , mCurrentGranPos(0)
+ //, mPrevGranPos(0)
+ //, mCurrentGranPos(0)
{
//debugLog.open("g:\\logs\\packetise.log", ios_base::out);
}
@@ -73,8 +73,8 @@
mPendingPacket = NULL;
mNumIgnorePackets = 0;
mPacketiserState = PKRSTATE_OK;
- mPrevGranPos = 0;
- mCurrentGranPos = 0;
+ //mPrevGranPos = 0;
+ //mCurrentGranPos = 0;
return true;
}
bool OggPacketiser::acceptOggPage(OggPage* inOggPage) { //AOP::: Needs closer look
@@ -88,15 +88,15 @@
//debugLog<<"acceptOggPage : Gran = "<<inOggPage->header()->GranulePos()<<"Num packs = "<<inOggPage->numPackets()<<endl;
//If the page isn't a -1 page and it's got a different granpos save it.
- if ( (inOggPage->header()->GranulePos() != -1) && (inOggPage->header()->GranulePos() != mCurrentGranPos)) {
- mPrevGranPos = mCurrentGranPos;
+ //if ( (inOggPage->header()->GranulePos() != -1) && (inOggPage->header()->GranulePos() != mCurrentGranPos)) {
+ // mPrevGranPos = mCurrentGranPos;
- //If the previous is higher than the
- if (mPrevGranPos > mCurrentGranPos) {
- mPrevGranPos = -1;
- }
- mCurrentGranPos = inOggPage->header()->GranulePos();
- }
+ // //If the previous is higher than the
+ // if (mPrevGranPos > mCurrentGranPos) {
+ // mPrevGranPos = -1;
+ // }
+ // mCurrentGranPos = inOggPage->header()->GranulePos();
+ //}
//If the page header says its a continuation page...
if ((inOggPage->header()->HeaderFlags() & 1) == 1) {
@@ -341,9 +341,9 @@
return true;
} else {
//Modify the header packet to include the gran pos of previous page.
- if (mPrevGranPos != -1) {
- inPacket->setTimeStamp(mPrevGranPos, mCurrentGranPos, StampedOggPacket::OGG_BOTH);
- }
+ //if (mPrevGranPos != -1) {
+ // inPacket->setTimeStamp(mPrevGranPos, mCurrentGranPos, StampedOggPacket::OGG_BOTH);
+ //}
//Dispatch it.
return mPacketSink->acceptStampedOggPacket(inPacket);
}
Modified: branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.h
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.h 2005-10-23 07:44:42 UTC (rev 10260)
+++ branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPacketiser.h 2005-10-23 07:59:04 UTC (rev 10261)
@@ -81,8 +81,8 @@
bool mLooseMode;
unsigned long mNumIgnorePackets;
- LOOG_INT64 mPrevGranPos;
- LOOG_INT64 mCurrentGranPos;
+ //LOOG_INT64 mPrevGranPos;
+ //LOOG_INT64 mCurrentGranPos;
bool processPage(OggPage* inOggPage, bool inIncludeFirst, bool inIncludeLast);
ePacketiserState mPacketiserState;
Modified: branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPage.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPage.cpp 2005-10-23 07:44:42 UTC (rev 10260)
+++ branches/oggdsf_new_demux/src/lib/core/ogg/libOOOgg/OggPage.cpp 2005-10-23 07:59:04 UTC (rev 10261)
@@ -134,7 +134,17 @@
//Returns a view on the packet only
StampedOggPacket* OggPage::getStampedPacket(unsigned long inPacketNo) {
if (inPacketNo < numPackets()) {
- return mPacketList[inPacketNo];
+ StampedOggPacket* retPacket = mPacketList[inPacketNo];
+
+ if ((int)inPacketNo != ((int)numPackets() - (mPacketList[numPackets() - 1]->isTruncated() ? 2 : 1))) {
+ //It's not the last complete packet, so it gets a -1 stamp
+ retPacket->setTimeStamp(-1, -1, StampedOggPacket::OGG_END_ONLY);
+ } else {
+ //It is the last complete packet
+
+ retPacket->setTimeStamp(-1, header()->GranulePos(), StampedOggPacket::OGG_END_ONLY);
+ }
+ return retPacket;
} else {
return NULL;
}
More information about the commits
mailing list