[xiph-commits] r7325 - in trunk/oggdsf/src:
illiminable at dactyl.lonelymoon.com
illiminable
Sun Jul 25 08:01:39 PDT 2004
lib/core/directshow/dsfOggDemux lib/core/directshow/dsfOggMux
lib/core/ogg/libOOOgg lib/core/ogg/libOOOggSeek
lib/core/ogg/libVorbisComment
lib/core/ogg/libVorbisCommentDotNET tools/OOOggCommentDump
Message-ID: <20040725150139.C77169AAAB at dactyl.lonelymoon.com>
Author: illiminable
Date: Sun Jul 25 08:01:39 2004
New Revision: 7325
Modified:
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggSegmentTable.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/StringHelper.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.vcproj
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h
trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp
Log:
* More tidying up in the demuxer library.
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -111,7 +111,7 @@
char* locBuff2 = locBuff + locPos + 4; //View only - don't delete.
locTemp = locBuff2;
//debugLog<<"Start of data follows"<<endl<<locTemp<<endl;
- mStreamBuffer.write(locBuff2, locNumRead - (locPos + 4));
+ mStreamBuffer.write(locBuff2, (std::streamsize)(locNumRead - (locPos + 4)));
//Dump to file
//fileDump.write(locBuff2, locNumRead - (locPos + 4));
@@ -212,7 +212,7 @@
bool HTTPFileSource::httpRequest(string inRequest) {
//debugLog<<"Http Request:"<<endl;
- int locRetVal = send(mSocket, inRequest.c_str(), inRequest.length(), 0);
+ int locRetVal = send(mSocket, inRequest.c_str(), (int)inRequest.length(), 0);
if (locRetVal == SOCKET_ERROR) {
//debugLog<<"Socket error on send"<<endl;
@@ -296,6 +296,7 @@
mServerName = locServerName;
mFileName = locPath;
if (locPort != "") {
+ //Error checking needed
mPort = atoi(locPort.c_str());
} else {
mPort = 0;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -425,7 +425,7 @@
// return NULL;
//}
- if (inPinNo >= 0 && inPinNo < mStreamMapper->numStreams()) {
+ if ((inPinNo >= 0) && (inPinNo < mStreamMapper->numStreams())) {
return mStreamMapper->getOggStream(inPinNo)->getPin();
} else {
return NULL;
@@ -589,7 +589,7 @@
if (mJustReset) { //To avoid blocking problems... restart the loop if it was just reset while waiting for lock.
continue;
}
- locKeepGoing = mOggBuffer.feed(locBuff, locBytesRead);
+ locKeepGoing = ((mOggBuffer.feed(locBuff, locBytesRead)) == (OggDataBuffer::FEED_OK));;
}
if (!locKeepGoing) {
//debugLog << "DataProcessLoop : Feed in data buffer said stop"<<endl;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -231,7 +231,7 @@
StampedOggPacket* locPacket = NULL;
//osDebug<<"New page sets start gran to "<<mLastEndGranulePos<<endl;
mLastStartGranulePos = mLastEndGranulePos;
- mLastEndGranulePos = inOggPage->header()->GranulePos()->value();
+ mLastEndGranulePos = inOggPage->header()->GranulePos();
if (!mStreamReady) {
@@ -266,7 +266,7 @@
//On the first run and after stop/restart resend excess packets.
if (mSendExcess) {
mSendExcess = false;
- unsigned long locNumExcess = mExcessPackets.size();
+ unsigned long locNumExcess = (unsigned long)mExcessPackets.size();
//for (unsigned long i = 0; i < locNumExcess; i++) {
// dispatchPacket(mExcessPackets[i]);
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -41,7 +41,7 @@
OggStreamMapper::~OggStreamMapper(void)
{
- for (int i = 0; i < mStreamList.size(); i++) {
+ for (size_t i = 0; i < mStreamList.size(); i++) {
delete mStreamList[i];
}
}
@@ -50,7 +50,7 @@
for (unsigned long i = 0; i < mStreamList.size(); i++) {
if (mStreamList[i]->serialNo() == inOggPage->header()->StreamSerialNo()) {
//This is the correct stream
- DbgLog((LOG_TRACE, 2, TEXT("Mapper : Dispatching page to serial %u",inOggPage->header()->StreamSerialNo())));
+ //DbgLog((LOG_TRACE, 2, TEXT("Mapper : Dispatching page to serial %u",inOggPage->header()->StreamSerialNo())));
return mStreamList[i]->acceptOggPage(inOggPage);
}
@@ -101,7 +101,7 @@
}
unsigned long OggStreamMapper::numStreams() {
- return mStreamList.size();
+ return (unsigned long)mStreamList.size();
}
OggStream* OggStreamMapper::getOggStream(unsigned long inPinNo) {
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -53,7 +53,7 @@
}
unsigned long StreamHeaders::numPackets() {
- return mPacketList.size();
+ return (unsigned long)mPacketList.size();
}
@@ -62,7 +62,7 @@
mPacketList.push_back(inPacket);
StampedOggPacket* loc = NULL;
- for (int i = 0; i < mPacketList.size(); i++) {
+ for (size_t i = 0; i < mPacketList.size(); i++) {
loc = mPacketList[i];
}
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -187,7 +187,7 @@
//BaseFilter Interface
int OggMuxFilter::GetPinCount() {
//TO DO::: Change this for multiple streams
- return mInputPins.size();
+ return (int)mInputPins.size();
}
CBasePin* OggMuxFilter::GetPin(int inPinNo) {
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h 2004-07-25 15:01:37 UTC (rev 7325)
@@ -33,7 +33,7 @@
#include "StampedOggPacket.h"
-class IStampedOggPacketSink
+class LIBOOOGG_API IStampedOggPacketSink
{
public:
IStampedOggPacketSink(void);
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -181,7 +181,7 @@
if(mStream.fail()) {
debugLog<<"ProcessBaseHeader : File Read FAILED"<<endl;
- return PROCESS_FILE_READ_ERROR;
+ return PROCESS_STREAM_READ_ERROR;
}
//Set the base header into the pending page
@@ -198,6 +198,7 @@
debugLog<<"ProcessBaseHeader : Bytes needed for seg table = "<<mNumBytesNeeded<<endl;
+ return PROCESS_OK;
}
OggDataBuffer::eProcessResult OggDataBuffer::processSegTable() {
@@ -219,11 +220,11 @@
debugLog<<"ProcessSegTable : Reading from buffer..."<<endl;
//Read from the stream buffer to it
- mStream.read((char*)locBuff, (size_t)locNumSegs);
+ mStream.read((char*)locBuff, (std::streamsize)locNumSegs);
if(mStream.fail()) {
debugLog<<"ProcessSegTable : Read FAILED"<<endl;
delete locBuff;
- return false;
+ return PROCESS_STREAM_READ_ERROR;
}
//TODAY::: Check out the page header class.
@@ -243,7 +244,7 @@
debugLog<<"ProcessSegTable : Transition to AWAITING_DATA"<<endl;
mState = AWAITING_DATA;
- return true;
+ return PROCESS_OK;
}
@@ -302,7 +303,8 @@
//A packet ends when a lacing value is not 255. So the check for != 255 means the isComplete property of the packet is not set unless the
// lacing value is not equal to 255.
- pendingPage->addPacket( new StampedOggPacket(locBuff, locCurrPackSize, (locSegTable[i] != 255), 0, pendingPage->header()->GranulePos()->value(), StampedOggPacket::OGG_END_ONLY ) );
+ //ERROR CHECK:::
+ pendingPage->addPacket( new StampedOggPacket(locBuff, locCurrPackSize, (locSegTable[i] != 255), 0, pendingPage->header()->GranulePos(), StampedOggPacket::OGG_END_ONLY ) );
//Reset the packet size counter.
locCurrPackSize = 0;
@@ -319,10 +321,10 @@
if (locRet == true) {
debugLog<<"ProcessDataSegment : Transition to AWAITING_BASE_HEADER"<<endl;
mState = AWAITING_BASE_HEADER;
- return true;
+ return PROCESS_OK;;
} else {
debugLog<<"ProcessDataSegment : Dispatch failed."<<endl;
- return false;
+ return PROCESS_DISPATCH_FAILED;
}
}
@@ -332,40 +334,51 @@
mStream.seekg(0, ios_base::beg);
mStream.seekp(0, ios_base::beg);
- //if (numBytesAvail() != 0) {
- // int i = i;
- //}
-
debugLog<<"ClearData : Transition back to AWAITING_BASE_HEADER"<<endl;
+
mState = eState::AWAITING_BASE_HEADER;
mNumBytesNeeded = OggPageHeader::OGG_BASE_HEADER_SIZE;
+
debugLog<<"ClearData : Num bytes needed = "<<mNumBytesNeeded<<endl;
}
+
OggDataBuffer::eProcessResult OggDataBuffer::processBuffer() {
debugLog<<"ProcessBuffer :"<<endl;
- bool locErr;
- eProcessResult locProcessResult = PROCESS_OK;
while (numBytesAvail() >= mNumBytesNeeded) {
debugLog<<"ProcessBuffer : Bytes Needed = "<<mNumBytesNeeded<<" --- "<<"Bytes avail = "<<numBytesAvail()<<endl;
switch (mState) {
+
+ //QUERY::: Should it be a bug when the if state inside the switch falls through,... potential for infinite loop.
case eState::AWAITING_BASE_HEADER:
debugLog<<"ProcessBuffer : State = AWAITING_BASE_HEADER"<<endl;
//If theres enough data to form the base header
if (numBytesAvail() >= OggPageHeader::OGG_BASE_HEADER_SIZE) {
debugLog<<"ProcessBuffer : Enough to process..."<<endl;
- return processBaseHeader();
+
+ eProcessResult locResult = processBaseHeader();
+
+ if (locResult != PROCESS_OK) {
+ //Base header process failed
+ return locResult;
}
}
break;
case eState::AWAITING_SEG_TABLE:
debugLog<<"ProcessBuffer : State = AWAITING_SEG_TABLE"<<endl;
+
//If there is enough data to get the segt table
if (numBytesAvail() >= pendingPage->header()->NumPageSegments()) {
debugLog<<"ProcessBuffer : Enough to process..."<<endl;
- return processSegTable();
+
+ eProcessResult locResult = processSegTable();
+
+ if (locResult != PROCESS_OK) {
+ //segment table process failed
+ return locResult;
+ }
}
break;
@@ -384,6 +397,8 @@
break;
}
}
+
+ //There wasn't enough data to progress if we are here.
return PROCESS_OK;
}
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h 2004-07-25 15:01:37 UTC (rev 7325)
@@ -60,15 +60,13 @@
FEED_OK,
FEED_NULL_POINTER = 64,
FEED_BUFFER_WRITE_ERROR
-
-
-
};
enum eProcessResult {
PROCESS_OK,
PROCESS_UNKNOWN_INTERNAL_ERROR = 256,
- PROCESS_FILE_READ_ERROR
+ PROCESS_STREAM_READ_ERROR,
+ PROCESS_DISPATCH_FAILED
};
OggDataBuffer(void);
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -40,7 +40,7 @@
{
}
-unsigned long OggMath::charArrToULong(unsigned char* inCharArray)
+unsigned long OggMath::charArrToULong(const unsigned char* inCharArray)
{
//Turns the next four bytes from the pointer in a long LSB (least sig. byte first/leftmost)
unsigned long locVal = 0;
@@ -53,7 +53,7 @@
void OggMath::ULongToCharArr(unsigned long inLong, unsigned char* outCharArray)
{
//Writes a long LSB (least sig. byte first/leftmost) out to the char arr
- unsigned long locLong = inLong;
+
outCharArray[3] = (unsigned char) (inLong >> 24);
outCharArray[2] = (unsigned char) ((inLong << 8) >> 24);
outCharArray[1] = (unsigned char) ((inLong << 16) >> 24);
@@ -61,3 +61,19 @@
}
+__int64 OggMath::CharArrToInt64(const unsigned char* inCharArray) {
+ __int64 locData = 0;
+
+ for (int i = 7; i >= 0; i--) {
+ locData <<= 8;
+ locData += inCharArray[i];
+ }
+ return locData;
+}
+
+void OggMath::Int64ToCharArr(__int64 inInt64, unsigned char* outCharArray) {
+ for (unsigned char i = 0; i < 8; i++) {
+ //This way sux !
+ outCharArray[i] = (unsigned char)((inInt64 << ((7 - i) * 8)) >> 56);
+ }
+}
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.h 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMath.h 2004-07-25 15:01:37 UTC (rev 7325)
@@ -36,8 +36,11 @@
public:
OggMath(void);
~OggMath(void);
- static unsigned long charArrToULong(unsigned char* inCharArray);
+ static unsigned long charArrToULong(const unsigned char* inCharArray);
static void ULongToCharArr(unsigned long inLong, unsigned char* outCharArray);
+ static __int64 CharArrToInt64(const unsigned char* inCharArray);
+ static void Int64ToCharArr(__int64 inInt64, unsigned char* outCharArray);
+
};
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -74,7 +74,7 @@
__int64 OggMuxStream::frontTime() {
__int64 retTime = INT64_MAX;
if (!mPageQueue.empty()) {
- retTime = mPageQueue.front()->header()->GranulePos()->value();
+ retTime = mPageQueue.front()->header()->GranulePos();;
}
return retTime;
}
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -72,30 +72,8 @@
}
return retClone;
-
}
-//OggPage* OggPage::clone() {
- //OggPage* retVal = new OggPage;
- //retVal->mPageState = mPageState;
- //retVal->mStructureVersion = mStructureVersion;
- //retVal->mHeaderFlags = mHeaderFlags;
- //retVal->mGranulePos = mGranulePos->clone();
- //retVal->mStreamSerialNo = mStreamSerialNo;
- //retVal->mPageSequenceNo = mPageSequenceNo;
- //retVal->mCRCChecksum = mCRCChecksum;
- //retVal->mNumPageSegments = mNumPageSegments;
- //retVal->mSegmentTable = mSegmentTable->clone();
- //retVal->mPageSize = mPageSize;
- //retVal->mHeaderSize = mHeaderSize;
- //retVal->mDataSize = mDataSize;
- ////CHECK ::: Check for datasize == 0
- //retVal->mPageData = new unsigned char[mDataSize];
- ////Check memory allocated
- //memcpy((void*) retVal->mPageData, (const void*) mPageData, mDataSize);
- //return retVal;
-
-//}
unsigned long OggPage::numPackets() {
return (unsigned long)mPacketList.size();
}
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -33,18 +33,40 @@
#include "oggpageheader.h"
+ //unsigned long mPageSize;
+ //unsigned long mHeaderSize;
+ //unsigned long mDataSize;
+
+ //unsigned char mStructureVersion;
+ //unsigned char mHeaderFlags;
+ //__int64 mGranulePos;
+ //unsigned long mStreamSerialNo;
+ //unsigned long mPageSequenceNo;
+ //unsigned long mCRCChecksum;
+ //unsigned char mNumPageSegments;
+ //OggSegmentTable* mSegmentTable;
+
+ //ePageState mPageState;
OggPageHeader::OggPageHeader(void)
- : mPageState(BLANK),
- mGranulePos(NULL),
- mSegmentTable(NULL),
- mDataSize(0)
+ : mPageSize(0)
+ , mHeaderSize(0)
+ , mDataSize(0)
+ , mStructureVersion(0)
+ , mHeaderFlags(0)
+ , mStreamSerialNo(0)
+ , mPageSequenceNo(0)
+ , mCRCChecksum(0)
+ , mPageState(BLANK)
+ , mGranulePos(0)
+ , mSegmentTable(NULL)
+
{
}
OggPageHeader::~OggPageHeader(void)
{
- delete mGranulePos;
+
delete mSegmentTable;
}
@@ -70,10 +92,10 @@
OggPageHeader* retClone = new OggPageHeader();
retClone->mCRCChecksum = mCRCChecksum;
retClone->mDataSize = mDataSize;
- retClone->mGranulePos = mGranulePos->clone();
+ retClone->mGranulePos = mGranulePos;
retClone->mHeaderFlags = mHeaderFlags;
retClone->mHeaderSize = mHeaderSize;
- retClone->mNumPageSegments = mNumPageSegments;
+ //retClone->mNumPageSegments = mNumPageSegments;
retClone->mPageSequenceNo = mPageSequenceNo;
retClone->mPageSize = mPageSize;
retClone->mPageState = mPageState;
@@ -105,11 +127,11 @@
outData[3] = 'S';
outData[4] = mStructureVersion;
outData[5] = mHeaderFlags;
- mGranulePos->rawData(&outData[6]);
+ OggMath::Int64ToCharArr(mGranulePos, &outData[6]);
OggMath::ULongToCharArr(mStreamSerialNo, &outData[14]);
OggMath::ULongToCharArr(mPageSequenceNo, &outData[18]);
OggMath::ULongToCharArr(mCRCChecksum, &outData[22]);
- outData[26] = mNumPageSegments;
+ outData[26] = mSegmentTable->numSegments();;
mSegmentTable->rawData(&outData[27]);
//EXIT POINT
@@ -139,11 +161,11 @@
string retStr = "Ver No : " + StringHelper::numToString((unsigned int)mStructureVersion) + "\n";
retStr += "Head Flags : " + StringHelper::numToString((unsigned int)mHeaderFlags) +"\n";
- retStr += "Granule Pos : " + StringHelper::numToString(mGranulePos->value()) + "\n";
+ retStr += "Granule Pos : " + StringHelper::numToString(mGranulePos) + "\n";
retStr += "Serial No : " + StringHelper::numToString(mStreamSerialNo) + "\n";
retStr += "Seq No : " + StringHelper::numToString(mPageSequenceNo) + "\n";
retStr += "Checksum : " + StringHelper::numToString(mCRCChecksum) + "\n";
- retStr += "Num Segs : " + StringHelper::numToString((unsigned int)mNumPageSegments) + "\n";
+ retStr += "Num Segs : " + StringHelper::numToString((unsigned int)mSegmentTable->numSegments()) + "\n";
retStr += "------------------------\n";
retStr += "Head Size : " + StringHelper::numToString(mHeaderSize) + "\n";
retStr += "Data Size : " + StringHelper::numToString(mDataSize) + "\n";
@@ -166,7 +188,7 @@
return mHeaderFlags;
}
-OggInt64* OggPageHeader::GranulePos()
+__int64 OggPageHeader::GranulePos()
{
return mGranulePos;
}
@@ -186,7 +208,11 @@
unsigned char OggPageHeader::NumPageSegments()
{
- return mNumPageSegments;
+ if (mSegmentTable == NULL) {
+ return mNumPageSegments;
+ } else {
+ return mSegmentTable->numSegments();
+ }
}
OggSegmentTable* OggPageHeader::SegmentTable()
{
@@ -195,28 +221,15 @@
-
-
-
-
-
-//MUTATORS
-
-bool OggPageHeader::setBaseHeader(unsigned char* inBaseHeader) {
+bool OggPageHeader::setBaseHeader(const unsigned char* inBaseHeader) {
+ //This now does not delete the buffer
bool locIsValidPage = true;
unsigned long locOffset = 0;
//Check if the page has the correct capture pattern
if (strncmp((const char*)inBaseHeader, "OggS", OGG_CAPTURE_PATTERN_SIZE) == 0) {
locIsValidPage = true;
- } else {
- locIsValidPage = false;
- }
- if (!locIsValidPage) {
- //EXIT POINT
- return false;
- } else {
if (mPageState == BLANK) {
locOffset += OGG_CAPTURE_PATTERN_SIZE;
@@ -229,11 +242,11 @@
locOffset++;
//Assign the granule pos
- setGranulePos(inBaseHeader + locOffset);
+ setGranulePos((const unsigned char*)(inBaseHeader + locOffset));
locOffset += 8;
//Assign Serial No
- setStreamSerialNo(inBaseHeader + locOffset);
+ setStreamSerialNo((const unsigned char*)(inBaseHeader + locOffset));
locOffset += 4;
//Assign Page Seq No
@@ -249,12 +262,12 @@
locOffset++;
//Set the size of the header
- setHeaderSize(OGG_BASE_HEADER_SIZE + mNumPageSegments);
+ setHeaderSize(OGG_BASE_HEADER_SIZE + mSegmentTable->numSegments());
mPageState = BASE_HEAD_SET;
//We are passed our own copy of this so we can delete it now.
- delete inBaseHeader;
+ //delete inBaseHeader;
//EXIT POINT
return true;
@@ -268,12 +281,16 @@
}
-
+ } else {
+ locIsValidPage = false;
+ return false;
}
+
+
}
-bool OggPageHeader::setSegmentTable(unsigned char* inSegTable) {
+bool OggPageHeader::setSegmentTable(const unsigned char* inSegTable, unsigned char inNumSegs) {
//This assumes that mNumPageSegments is set.
//ISSUE ::: What happens when numPageSegments is zero ?
@@ -282,7 +299,7 @@
OggSegmentTable* locSegTable = new OggSegmentTable;
//Put the data in it and set the pagedata size
- unsigned long locDataSize = locSegTable->setSegmentTable(inSegTable, mNumPageSegments);
+ unsigned long locDataSize = locSegTable->setSegmentTable(inSegTable, inNumSegs);
setDataSize( locDataSize );
//Assign the segtable into the page, the page header will look after deleing the memory.
@@ -309,21 +326,20 @@
mHeaderFlags = inVal;
}
-void OggPageHeader::setGranulePos(OggInt64* inPtr)
+void OggPageHeader::setGranulePos(__int64 inGranulePos)
{
- mGranulePos = inPtr;
+ mGranulePos = inGranulePos;
}
-void OggPageHeader::setGranulePos(unsigned char* inPtr)
+void OggPageHeader::setGranulePos(const unsigned char* inPtr)
{
- mGranulePos = new OggInt64();
- mGranulePos->setData(inPtr);
+ mGranulePos = OggMath::CharArrToInt64(inPtr);
}
void OggPageHeader::setStreamSerialNo(unsigned long inVal)
{
mStreamSerialNo = inVal;
}
-void OggPageHeader::setStreamSerialNo(unsigned char* inPtr)
+void OggPageHeader::setStreamSerialNo(const unsigned char* inPtr)
{
mStreamSerialNo = OggMath::charArrToULong(inPtr);
}
@@ -331,7 +347,7 @@
{
mPageSequenceNo = inVal;
}
-void OggPageHeader::setPageSequenceNo(unsigned char* inPtr)
+void OggPageHeader::setPageSequenceNo(const unsigned char* inPtr)
{
mPageSequenceNo = OggMath::charArrToULong(inPtr);;
}
@@ -339,7 +355,7 @@
{
mCRCChecksum = inVal;
}
-void OggPageHeader::setCRCChecksum(unsigned char* inPtr)
+void OggPageHeader::setCRCChecksum(const unsigned char* inPtr)
{
mCRCChecksum = OggMath::charArrToULong(inPtr);;
@@ -347,11 +363,14 @@
void OggPageHeader::setNumPageSegments(unsigned char inVal)
{
- mNumPageSegments = inVal;
+ if (mSegmentTable == NULL) {
+ mNumPageSegments = inVal;
+ }
}
void OggPageHeader::setSegmentTable(OggSegmentTable* inPtr)
{
//Keeps your pointer !
+ delete mSegmentTable;
mSegmentTable = inPtr;
}
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h 2004-07-25 15:01:37 UTC (rev 7325)
@@ -45,7 +45,7 @@
public:
OggPageHeader(void);
~OggPageHeader(void);
-
+ OggPageHeader* clone();
//0-3 CapPattern "Oggs"
//4 Struct Ver
//5 Head Flags
@@ -70,30 +70,31 @@
BOS = 2,
EOS = 4
};
- OggPageHeader* clone();
+
bool rawData(unsigned char* outData, unsigned long inBuffSize);
- //ACCESSORS
+
+ //State variables
ePageState pageState();
void setPageState(ePageState inPageState);
+ //Access header flags
bool isBOS();
bool isEOS();
- string toString();
-
+ //Size variables
unsigned long pageSize();
unsigned long headerSize();
unsigned long dataSize();
//Bulk Mutators
- bool setBaseHeader(unsigned char* inBaseHeader);
- bool setSegmentTable(unsigned char* inSegTable);
+ bool setBaseHeader(const unsigned char* inBaseHeader);
+ bool setSegmentTable(const unsigned char* inSegTable, unsigned char inNumSegs);
unsigned char StructureVersion();
unsigned char HeaderFlags();
- OggInt64* GranulePos();
+ __int64 GranulePos();
unsigned long StreamSerialNo();
unsigned long PageSequenceNo();
unsigned long CRCChecksum();
@@ -104,14 +105,14 @@
void setStructureVersion(unsigned char inVal);
void setHeaderFlags(unsigned char inVal);
- void setGranulePos(OggInt64* inPtr);
- void setGranulePos(unsigned char* inPtr);
+ void setGranulePos(__int64 inPtr);
+ void setGranulePos(const unsigned char* inPtr);
void setStreamSerialNo(unsigned long inVal);
- void setStreamSerialNo(unsigned char* inPtr);
+ void setStreamSerialNo(const unsigned char* inPtr);
void setPageSequenceNo(unsigned long inVal);
- void setPageSequenceNo(unsigned char* inPtr);
+ void setPageSequenceNo(const unsigned char* inPtr);
void setCRCChecksum(unsigned long inVal);
- void setCRCChecksum(unsigned char* inPtr);
+ void setCRCChecksum(const unsigned char* inPtr);
void setNumPageSegments(unsigned char inVal);
void setSegmentTable(OggSegmentTable* inPtr);
@@ -119,6 +120,7 @@
void setDataSize(unsigned long inVal);
+ string toString();
protected:
@@ -129,7 +131,7 @@
unsigned char mStructureVersion;
unsigned char mHeaderFlags;
- OggInt64* mGranulePos;
+ __int64 mGranulePos;
unsigned long mStreamSerialNo;
unsigned long mPageSequenceNo;
unsigned long mCRCChecksum;
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -110,7 +110,7 @@
void OggPageInterleaver::writeLowest() {
OggMuxStream* locLowestStream = NULL;
- for (int i = 0; i < mInputStreams.size(); i++) {
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
if (!mInputStreams[i]->isEmpty() && mInputStreams[i]->isActive()) {
if (locLowestStream == NULL) {
locLowestStream = mInputStreams[i];
@@ -128,7 +128,7 @@
(mInputStreams[i]->peekFront()->header()->isBOS()) ) ||
( (mInputStreams[i]->peekFront() != NULL) &&
- ((mInputStreams[i]->peekFront()->header()->GranulePos()->value()) == -1) ) ||
+ ((mInputStreams[i]->peekFront()->header()->GranulePos()) == -1) ) ||
(locTestLowTime < locCurrLowTime)
)
{
@@ -150,7 +150,7 @@
bool OggPageInterleaver::isProcessable() {
bool retVal = true;
//ASSERT(mInputStreams.size() >= 1)
- for (int i = 0; i < mInputStreams.size(); i++) {
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
retVal = retVal && (mInputStreams[i]->isProcessable());
}
return retVal;
@@ -158,7 +158,7 @@
bool OggPageInterleaver::isAllEOS() {
bool retVal = true;
//ASSERT(mInputStreams.size() >= 1)
- for (int i = 0; i < mInputStreams.size(); i++) {
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
if (mInputStreams[i]->isEOS()) {
//debugLog<<"***** Stream "<<i<<" is EOS"<<endl;
} else {
@@ -172,7 +172,7 @@
bool OggPageInterleaver::isAllEmpty() {
bool retVal = true;
//ASSERT(mInputStreams.size() >= 1)
- for (int i = 0; i < mInputStreams.size(); i++) {
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
retVal = retVal && (mInputStreams[i]->isEmpty());
}
return retVal;
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -207,7 +207,7 @@
unsigned char* locBuff = new unsigned char[300];
mPendingPage->header()->rawData(locBuff, 300);
- for(int i = 0; i < mPendingPage->headerSize(); i++) {
+ for(unsigned long i = 0; i < mPendingPage->headerSize(); i++) {
//Create the index we use for the lookup
locTemp = ((locChecksum >> 24) & 0xff) ^ locBuff[i];
//XOR the lookup value with the the current checksum shifted left 8 bits.
@@ -217,10 +217,10 @@
delete locBuff;
locBuff = NULL;
- for(int i = 0; i < mPendingPage->numPackets(); i++) {
+ for(unsigned long i = 0; i < mPendingPage->numPackets(); i++) {
locBuff = mPendingPage->getPacket(i)->packetData();
- for (int j = 0; j < mPendingPage->getPacket(i)->packetSize(); j++) {
+ for (unsigned long j = 0; j < mPendingPage->getPacket(i)->packetSize(); j++) {
locTemp = ((locChecksum >> 24) & 0xff) ^ locBuff[j];
locChecksum = (locChecksum << 8) ^ crc_lookup[locTemp];
}
@@ -234,8 +234,8 @@
bool OggPaginator::deliverCurrentPage() {
mPendingPage->header()->setDataSize(mCurrentPageSize);
mPendingPage->header()->setHeaderSize(OggPageHeader::OGG_BASE_HEADER_SIZE + mSegmentTableSize);
- mPendingPage->header()->setNumPageSegments(mSegmentTableSize);
- mPendingPage->header()->setSegmentTable(mSegmentTable);
+ //mPendingPage->header()->setNumPageSegments(mSegmentTableSize);
+ mPendingPage->header()->setSegmentTable((const unsigned char*)mSegmentTable, mSegmentTableSize);
//if (mPendingPage->header()->GranulePos()->value() == -1) {
// mPendingPage->header()->setHeaderFlags(mPendingPage->header()->HeaderFlags() | 1);
//}
@@ -262,9 +262,8 @@
} else {
mPendingPage->header()->setHeaderFlags(0);
}
- OggInt64* locGranulePos = new OggInt64;
- locGranulePos->setValue(-1);
- mPendingPage->header()->setGranulePos(locGranulePos);
+
+ mPendingPage->header()->setGranulePos(-1);
mSequenceNo++;
return true;
@@ -349,7 +348,7 @@
inOggPacket->mStampType);
mPendingPage->addPacket(locPartialPacket);
unsigned long locNumSegsNeeded = (inLength / 255) + 1;
- for (int i = 0; i < locNumSegsNeeded - 1; i++) {
+ for (unsigned long i = 0; i < locNumSegsNeeded - 1; i++) {
mSegmentTable[mSegmentTableSize] = 255;
mSegmentTableSize++;
}
@@ -362,9 +361,8 @@
}
mCurrentPageSize += (locNumSegsNeeded + inLength);
if (locIsLastOfPacket) {
- OggInt64* locGranulePos = new OggInt64;
- locGranulePos->setValue(inOggPacket->endTime());
- mPendingPage->header()->setGranulePos(locGranulePos);
+
+ mPendingPage->header()->setGranulePos(inOggPacket->endTime());
}
return true;
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h 2004-07-25 15:01:37 UTC (rev 7325)
@@ -70,7 +70,7 @@
unsigned long mCurrentPageSize;
unsigned char mSegmentTable[255];
- unsigned long mSegmentTableSize;
+ unsigned char mSegmentTableSize;
unsigned long mSequenceNo;
bool mPendingPageHasData;
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggSegmentTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggSegmentTable.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggSegmentTable.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -92,6 +92,7 @@
//Make a new buffer.
unsigned char* locSegTablePtr = new unsigned char[inNumSegments];
+ //SLOW:::
//Copy the incoming data into the new segemnt buffer
memcpy((void*)locSegTablePtr, (const void*)inSegTable, inNumSegments);
mSegmentTable = locSegTablePtr;
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/StringHelper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/StringHelper.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/StringHelper.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -86,7 +86,7 @@
unsigned __int64 StringHelper::stringToNum(string inString) {
int locDigit = 0;
unsigned __int64 retVal = 0;
- unsigned long locStrLen = inString.length();
+ size_t locStrLen = inString.length();
for (unsigned long i = 0; i < locStrLen; i++) {
locDigit = inString[i] - '0';
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.vcproj 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.vcproj 2004-07-25 15:01:37 UTC (rev 7325)
@@ -24,11 +24,10 @@
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="3"
- WarningLevel="3"
+ WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
- CallingConvention="2"
- DisableSpecificWarnings="4251"/>
+ CallingConvention="2"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -104,7 +104,7 @@
}
- if ((mFoundStreamInfo) && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) && (inOggPage->header()->GranulePos()->value() != -1)) {
+ if ((mFoundStreamInfo) && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) && (inOggPage->header()->GranulePos() != -1)) {
//if ((mPacketCount > 3) && (mLastIsSeekable == true)) {
if ((mPacketCount > mNumHeaders) && ((inOggPage->header()->HeaderFlags() & 1) != 1)) {
addSeekPoint(mLastSeekTime, mFilePos);
@@ -115,16 +115,16 @@
if (isTheora) {
unsigned long locMod = (unsigned long)pow(2, mGranulePosShift);
- unsigned long locInterFrameNo = ((inOggPage->header()->GranulePos()->value()) % locMod);
+ unsigned long locInterFrameNo = ((inOggPage->header()->GranulePos()) % locMod);
//if (locInterFrameNo == 0) {
// mLastIsSeekable = true;
//} else {
// mLastIsSeekable = false;
//}
- mLastSeekTime = ((((inOggPage->header()->GranulePos()->value()) >> mGranulePosShift) + locInterFrameNo) * DS_UNITS) / mSampleRate;
+ mLastSeekTime = ((((inOggPage->header()->GranulePos()) >> mGranulePosShift) + locInterFrameNo) * DS_UNITS) / mSampleRate;
} else {
- mLastSeekTime = ((inOggPage->header()->GranulePos()->value()) * DS_UNITS) / mSampleRate;
+ mLastSeekTime = ((inOggPage->header()->GranulePos()) * DS_UNITS) / mSampleRate;
//stDebug<<"Last Seek Time : "<<mLastSeekTime;
}
if (((inOggPage->header()->HeaderFlags() & 1) == 1)) {
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -112,7 +112,7 @@
bool FileComments::writeOutAll(string inFileName) {
fstream locFile;
- locFile.open(inFileName, ios_base::out | ios_base::in | ios_base::binary);
+ locFile.open(inFileName.c_str(), ios_base::out | ios_base::in | ios_base::binary);
if (locFile.is_open()) {
@@ -137,5 +137,5 @@
}
unsigned long FileComments::streamCount() {
- return mStreams.size();
+ return (unsigned long)mStreams.size();
}
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h 2004-07-25 15:01:37 UTC (rev 7325)
@@ -51,7 +51,7 @@
bool loadFile(string inFileName);
string fileName();
- bool writeOutAll();
+ bool writeOutAll(string inFileName);
bool writeOutStream(unsigned long inIndex);
bool addStreamComment(StreamCommentInfo* inStreamComment);
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -50,7 +50,7 @@
}
unsigned long VorbisComments::numUserComments() {
- return mCommentList.size();
+ return (unsigned long)mCommentList.size();
}
SingleVorbisComment* VorbisComments::getUserComment(unsigned long inIndex) {
//FIX::: Bounds checking
@@ -62,7 +62,7 @@
vector<SingleVorbisComment*> retComments;
SingleVorbisComment* locCurrComment = NULL;
- for (int i = 0; i < mCommentList.size(); i++) {
+ for (size_t i = 0; i < mCommentList.size(); i++) {
locCurrComment = mCommentList[i];
//FIX::: Need to upcase everything
if (locCurrComment->key() == inKey) {
@@ -188,7 +188,7 @@
mCommentList.empty();
mCommentList.clear();
- for (int j = 0; j < locCommentList.size(); j++) {
+ for (size_t j = 0; j < locCommentList.size(); j++) {
mCommentList.push_back(locCommentList[j]);
}
} else {
@@ -211,7 +211,7 @@
retStr = "VENDOR : " + mVendorString + "\n\n";
retStr +="USER COMMENTS\n";
retStr +="=============\n";
- for (int i = 0; i < mCommentList.size(); i++) {
+ for (size_t i = 0; i < mCommentList.size(); i++) {
retStr += mCommentList[i]->toString() + "\n";
}
return retStr;
@@ -220,9 +220,9 @@
unsigned long VorbisComments::size() {
unsigned long locPackSize = 0;
- locPackSize = mVendorString.size() + 4;
+ locPackSize = (unsigned long)mVendorString.size() + 4;
- for (int i = 0; i < mCommentList.size(); i++) {
+ for (size_t i = 0; i < mCommentList.size(); i++) {
locPackSize += mCommentList[i]->length() + 4;
}
@@ -246,16 +246,16 @@
locPackData = new unsigned char[locPackSize];
}
- OggMath::ULongToCharArr(mVendorString.length(), locPackData + locUpto);
+ OggMath::ULongToCharArr((unsigned long)mVendorString.length(), locPackData + locUpto);
locUpto += 4;
memcpy((void*)(locPackData + locUpto), (const void*)mVendorString.c_str(), mVendorString.length());
- locUpto += mVendorString.length();
+ locUpto += (unsigned long)mVendorString.length();
- OggMath::ULongToCharArr(mCommentList.size(), locPackData + locUpto);
+ OggMath::ULongToCharArr((unsigned long)mCommentList.size(), locPackData + locUpto);
locUpto += 4;
- for (int i = 0; i < mCommentList.size(); i++) {
+ for (size_t i = 0; i < mCommentList.size(); i++) {
OggMath::ULongToCharArr(mCommentList[i]->length(), locPackData + locUpto);
locUpto += 4;
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -30,18 +30,23 @@
return Wrappers::CStrToNetStr(mNativeClass->fileName().c_str());
}
-bool DNFileComments::writeOutAll() {
- return mNativeClass->writeOutAll();
+bool DNFileComments::writeOutAll(String* inFileName) {
+ char* locCS = Wrappers::netStrToCStr(inFileName);
+ string locStr = locCS;
+ bool locRet = mNativeClass->writeOutAll(locStr);
+ Wrappers::releaseCStr(locCS);
+ return locRet;
+
}
bool DNFileComments::writeOutStream(Int64 inIndex) {
- return mNativeClass->writeOutStream(inIndex);
+ return mNativeClass->writeOutStream((unsigned long)inIndex);
}
//bool DNFileComments::addStreamComment(DNStreamCommentInfo* inStreamComment) {
//
//}
DNStreamCommentInfo* DNFileComments::getStreamComment(Int64 inIndex) {
- return new illiminable::Ogg::libVorbisCommentDotNET::DNStreamCommentInfo(mNativeClass->getStreamComment(inIndex));
+ return new illiminable::Ogg::libVorbisCommentDotNET::DNStreamCommentInfo(mNativeClass->getStreamComment((unsigned long)inIndex));
}
Int64 DNFileComments::streamCount() {
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h 2004-07-25 15:01:37 UTC (rev 7325)
@@ -24,7 +24,7 @@
// bool loadFile(string inFileName);
// string fileName();
//
-// bool writeOutAll();
+// bool writeOutAll(string inFileName);
// bool writeOutStream(unsigned long inIndex);
//
// bool addStreamComment(StreamCommentInfo* inStreamComment);
@@ -54,7 +54,7 @@
bool loadFile(String* inFileName);
String* fileName();
- bool writeOutAll();
+ bool writeOutAll(String* inFileName);
bool writeOutStream(Int64 inIndex);
//bool addStreamComment(DNStreamCommentInfo* inStreamComment);
Modified: trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp 2004-07-25 12:42:41 UTC (rev 7324)
+++ trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp 2004-07-25 15:01:37 UTC (rev 7325)
@@ -90,7 +90,7 @@
FileComments locFileComments;
StreamCommentInfo* locStreamInfo = NULL;
locFileComments.loadFile(argv[1]);
- for (int i = 0; i < locFileComments.streamCount(); i++) {
+ for (unsigned long i = 0; i < locFileComments.streamCount(); i++) {
locStreamInfo = locFileComments.getStreamComment(i);
cout<<"Stream "<<locStreamInfo->majorStreamNo()<<":"<<locStreamInfo->minorStreamNo()<<endl;
More information about the commits
mailing list