[xiph-commits] r8592 - in trunk/oggdsf/src: lib/helper/libOOOggChef
tools/mod_oggchef
ozone at motherfish-iii.xiph.org
ozone at motherfish-iii.xiph.org
Mon Jan 3 09:03:19 PST 2005
Author: ozone
Date: 2005-01-03 09:03:19 -0800 (Mon, 03 Jan 2005)
New Revision: 8592
Modified:
trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp
trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h
trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp
trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.vcproj
Log:
oggdsf:
* Timed URI support works in mod_oggchef again (so now we can do stream extraction, timed URIs, or both at once)
Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp 2005-01-03 09:20:13 UTC (rev 8591)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp 2005-01-03 17:03:19 UTC (rev 8592)
@@ -5,20 +5,23 @@
#include <libOOOgg/libOOOgg.h>
#include <libOOOggSeek/AutoAnxSeekTable.h>
+#include <assert.h>
+
#include <fstream>
+#include <iostream>
#include <string>
#include <vector>
using namespace std;
-#define DEBUG
+#undef DEBUG
AnnodexRecomposer::AnnodexRecomposer(string inFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData)
: mFilename(inFilename)
, mDemuxState(SEEN_NOTHING)
- , mStartOfBodyOffset(0)
+ , mDemuxParserState(LOOK_FOR_HEADERS)
, mRequestedTime(0)
, mBufferWriter(inBufferWriter)
, mBufferWriterUserData(inBufferWriterUserData)
@@ -35,42 +38,105 @@
{
mWantedMIMETypes = inWantedMIMETypes;
+#ifdef DEBUG
+ mDebugFile.open("G:\\Logs\\AnnodexRecomposer.log", ios_base::out);
+ mDebugFile << "AnnodexRecomposer 1 " << endl;
+#endif
+
+ static const size_t BUFF_SIZE = 8192;
+
+ // Open the file and prepare the OggDataBuffer to receive pages
fstream mFile;
mFile.open(mFilename.c_str(), ios_base::in | ios_base::binary);
- static const size_t BUFF_SIZE = 8192;
-
// Build a seek table from the file, so we can find out the end location of
// the stream headers, and the byte position of the user's requested start
// time
AutoAnxSeekTable *locSeekTable = new AutoAnxSeekTable(mFilename);
locSeekTable->buildTable();
- // Seek to the user's requested start time
- mStartOfBodyOffset = locSeekTable->getStartPos(0).second;
-
- mRequestedTime = (LOOG_UINT64) inStartingTimeOffset * 10000000;
- //mRequestedTimeOffset = locSeekTable->getStartPos(locStartTime).second;
+ // Find out where the non-header packets (i.e. the stream body) starts
- // TODO: Grab the headers from the stream (ack'ing preferred MIME type)
- // TODO: Grab data from the stream at offset (ack'ing preferred MIME type)
+ // n.b. We should be using the following line of code to do this:
+ //
+ // unsigned long locStartOfBodyOffset = locSeekTable->getStartPos(0).second;
+ //
+ // ... since that should return the body offset, but there's a bug in
+ // AutoAnxSeekTable (or AutoOggSeekTable) which makes that sometimes
+ // return 0, which makes it useless for our purposes. So, we force feed
+ // the first 640K of the file, which should be enough to detect any headers ;)
- OggDataBuffer locOggBuffer;
- locOggBuffer.registerVirtualCallback(this);
+ unsigned long locStartOfBodyOffset = 640 * 1024;
- char *locBuffer = new char[BUFF_SIZE];
- for (;;)
+#ifdef DEBUG
+ mDebugFile << "Filename: " << mFilename << endl;
+ mDebugFile << "locStartOfBodyOffset: " << locStartOfBodyOffset << endl;
+#endif
+
+ // Grab the headers from the stream
+ mDemuxParserState = LOOK_FOR_HEADERS;
{
- mFile.read(locBuffer, BUFF_SIZE);
- unsigned long locBytesRead = mFile.gcount();
- if (locBytesRead <= 0) {
- break;
+ OggDataBuffer locOggBuffer;
+ locOggBuffer.registerVirtualCallback(this);
+
+ unsigned long locBytesRead = 0;
+ char *locBuffer = new char[BUFF_SIZE];
+ while (locBytesRead < locStartOfBodyOffset)
+ {
+ // MIN is defined in OggPaginator.h (and in about three zillion other
+ // projects)
+ unsigned long locBytesToRead =
+ MIN(locStartOfBodyOffset - locBytesRead, BUFF_SIZE);
+ mFile.read(locBuffer, locBytesToRead);
+ unsigned long locBytesReadThisIteration = mFile.gcount();
+ if (locBytesReadThisIteration <= 0) {
+ break;
+ }
+ locOggBuffer.feed((unsigned char *) locBuffer, locBytesReadThisIteration);
}
- locOggBuffer.feed((unsigned char *) locBuffer, locBytesRead);
}
+ // Grab data from the stream at offset
+ LOOG_UINT64 locRequestedStartTime =
+ (LOOG_UINT64) inStartingTimeOffset * 10000000;
+ unsigned long locRequestedStartTimeOffset =
+ locSeekTable->getStartPos(locRequestedStartTime).second;
+
+ // Re-open the file, to avoid any fallout from reading the headers
+ mFile.clear();
+ mFile.seekg(locRequestedStartTimeOffset);
+
+#ifdef DEBUG
+ mDebugFile << "locRequestedStartTime: " << locRequestedStartTime << endl;
+ mDebugFile << "locRequestedStartTimeOffset: " << locRequestedStartTimeOffset << endl;
+ mDebugFile << "Current position: " << mFile.tellg() << endl;
+#endif
+
+ mDemuxParserState = LOOK_FOR_BODY;
+ {
+ OggDataBuffer locOggBuffer;
+ locOggBuffer.registerVirtualCallback(this);
+
+ char *locBuffer = new char[BUFF_SIZE];
+ for (;;)
+ {
+ mFile.read(locBuffer, BUFF_SIZE);
+ unsigned long locBytesReadThisIteration = mFile.gcount();
+ if (locBytesReadThisIteration <= 0) {
+ break;
+ }
+ locOggBuffer.feed((unsigned char *) locBuffer, locBytesReadThisIteration);
+ }
+ }
+
// Tidy up
mFile.close();
+
+#ifdef DEBUG
+ mDebugFile << "----------------" << endl;
+ mDebugFile.close();
+#endif
+
}
bool isAnnodexBOSPage (OggPage *inOggPage)
@@ -137,124 +203,155 @@
bool AnnodexRecomposer::acceptOggPage(OggPage* inOggPage)
{
- switch (mDemuxState) {
+ if (mDemuxParserState == LOOK_FOR_HEADERS) {
- case SEEN_NOTHING:
- if (isAnnodexBOSPage(inOggPage)) {
- mDemuxState = SEEN_ANNODEX_BOS;
+ switch (mDemuxState) {
- // Remember the Annodex stream's serial number, so we can output it later
- mAnnodexSerialNumber = inOggPage->header()->StreamSerialNo();
- mWantedStreamSerialNumbers.push_back(make_pair<unsigned long, unsigned long>(mAnnodexSerialNumber, 0));
+ case SEEN_NOTHING:
+ if (isAnnodexBOSPage(inOggPage)) {
+ mDemuxState = SEEN_ANNODEX_BOS;
- if (!wantOnlyPacketBody(mWantedMIMETypes)) {
- // Send out the page
- mBufferWriter(inOggPage->createRawPageData(),
- inOggPage->pageSize(), mBufferWriterUserData);
+ // Remember the Annodex stream's serial number, so we can output it later
+ mAnnodexSerialNumber = inOggPage->header()->StreamSerialNo();
+ mWantedStreamSerialNumbers.push_back(make_pair<unsigned long, unsigned long>(mAnnodexSerialNumber, 0));
+
+ if (!wantOnlyPacketBody(mWantedMIMETypes)) {
+ // Send out the page
+ mBufferWriter(inOggPage->createRawPageData(),
+ inOggPage->pageSize(), mBufferWriterUserData);
+ }
+ } else {
+ // The Annodex BOS page should always be the very first page of
+ // the stream, so if we don't see it, the stream's invalid
+ mDemuxState = INVALID;
}
- } else {
- // The Annodex BOS page should always be the very first page of
- // the stream, so if we don't see it, the stream's invalid
- mDemuxState = INVALID;
- }
- break;
+ break;
- case SEEN_ANNODEX_BOS:
- if (isAnxDataPage(inOggPage)) {
- unsigned long locSerialNumber = inOggPage->header()->StreamSerialNo();
- string locMimeType = mimeType(inOggPage->getPacket(0));
+ case SEEN_ANNODEX_BOS:
+ if (isAnxDataPage(inOggPage)) {
+ unsigned long locSerialNumber = inOggPage->header()->StreamSerialNo();
+ string locMimeType = mimeType(inOggPage->getPacket(0));
- for (unsigned int i = 0; i < mWantedMIMETypes->size(); i++) {
- if ( mWantedMIMETypes->at(i) == locMimeType
- || mWantedMIMETypes->at(i) == "*/*" /* accept all */) {
- // Create an association of serial no and num headers
- tSerial_HeadCountPair locMap;
- locMap.first = locSerialNumber;
- locMap.second = secondaryHeaders(inOggPage->getPacket(0));
+ for (unsigned int i = 0; i < mWantedMIMETypes->size(); i++) {
+ if ( mWantedMIMETypes->at(i) == locMimeType
+ || mWantedMIMETypes->at(i) == "*/*" /* accept all */) {
+ // Create an association of serial no and num headers
+ tSerial_HeadCountPair locMap;
+ locMap.first = locSerialNumber;
+ locMap.second = secondaryHeaders(inOggPage->getPacket(0));
- // Add the association to our stream list
- mWantedStreamSerialNumbers.push_back(locMap);
+ // Add the association to our stream list
+ mWantedStreamSerialNumbers.push_back(locMap);
- if (!wantOnlyPacketBody(mWantedMIMETypes)) {
- mBufferWriter(inOggPage->createRawPageData(),
- inOggPage->pageSize(), mBufferWriterUserData);
+ if (!wantOnlyPacketBody(mWantedMIMETypes)) {
+ mBufferWriter(inOggPage->createRawPageData(),
+ inOggPage->pageSize(), mBufferWriterUserData);
+ }
+
+ break;
}
-
- break;
}
+ } else if (isAnnodexEOSPage(inOggPage, mAnnodexSerialNumber)) {
+ mDemuxState = SEEN_ANNODEX_EOS;
+ if (!wantOnlyPacketBody(mWantedMIMETypes)) {
+ mBufferWriter(inOggPage->createRawPageData(),
+ inOggPage->pageSize(), mBufferWriterUserData);
+ }
+ } else {
+ // We didn't spot either an AnxData page or the Annodex EOS: WTF?
+ mDemuxState = INVALID;
}
- } else if (isAnnodexEOSPage(inOggPage, mAnnodexSerialNumber)) {
- mDemuxState = SEEN_ANNODEX_EOS;
- if (!wantOnlyPacketBody(mWantedMIMETypes)) {
- mBufferWriter(inOggPage->createRawPageData(),
- inOggPage->pageSize(), mBufferWriterUserData);
- }
- } else {
- // We didn't spot either an AnxData page or the Annodex EOS: WTF?
- mDemuxState = INVALID;
- }
- break;
+ break;
- case SEEN_ANNODEX_EOS:
- {
- // Only output headers for the streams that the user wants
- // in their request
- for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
- if (mWantedStreamSerialNumbers[i].first == inOggPage->header()->StreamSerialNo()) {
- if (mWantedStreamSerialNumbers[i].second >= 1) {
- mWantedStreamSerialNumbers[i].second--;
- if (wantOnlyPacketBody(mWantedMIMETypes)) {
- OggPacket* locPacket = inOggPage->getPacket(0);
- mBufferWriter(locPacket->packetData(),
- locPacket->packetSize(), mBufferWriterUserData);
- } else {
- mBufferWriter(inOggPage->createRawPageData(),
- inOggPage->pageSize(), mBufferWriterUserData);
+ case SEEN_ANNODEX_EOS:
+ {
+ // Only output headers for the streams that the user wants
+ // in their request
+ for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
+ if (mWantedStreamSerialNumbers[i].first == inOggPage->header()->StreamSerialNo()) {
+ if (mWantedStreamSerialNumbers[i].second >= 1) {
+ mWantedStreamSerialNumbers[i].second--;
+ if (wantOnlyPacketBody(mWantedMIMETypes)) {
+ OggPacket* locPacket = inOggPage->getPacket(0);
+ mBufferWriter(locPacket->packetData(),
+ locPacket->packetSize(), mBufferWriterUserData);
+ } else {
+ mBufferWriter(inOggPage->createRawPageData(),
+ inOggPage->pageSize(), mBufferWriterUserData);
+ }
+ }
+#if 0
+ else {
+ mDemuxState = INVALID;
}
- } else {
- mDemuxState = INVALID;
+#endif
}
}
- }
- bool allEmpty = true;
- for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
- if (mWantedStreamSerialNumbers[i].second != 0) {
- allEmpty = false;
+ bool allEmpty = true;
+ for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
+ if (mWantedStreamSerialNumbers[i].second != 0) {
+ allEmpty = false;
+ }
}
+
+ if (allEmpty) {
+ mDemuxState = SEEN_ALL_CODEC_HEADERS;
+ }
}
+ break;
+ case SEEN_ALL_CODEC_HEADERS:
+ // Seen all the headers: don't do anything
+ break;
+ case INVALID:
+ break;
+ default:
+ break;
+ }
- if (allEmpty) {
- mDemuxState = SEEN_ALL_CODEC_HEADERS;
- }
- }
+ } else if (mDemuxParserState == LOOK_FOR_BODY) {
+
+ switch (mDemuxState) {
+
+ case SEEN_NOTHING:
+ case SEEN_ANNODEX_BOS:
+ case SEEN_ANNODEX_EOS:
+#ifdef DEBUG
+ mDebugFile << "Looking for body, state is " << mDemuxState << endl;
+#endif
break;
- case SEEN_ALL_CODEC_HEADERS:
- {
- // Only output streams which the user requested
- for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
- if ( mWantedStreamSerialNumbers[i].first
- == inOggPage->header()->StreamSerialNo()) {
- if (wantOnlyPacketBody(mWantedMIMETypes)) {
- for (unsigned long j = 0; j < inOggPage->numPackets(); j++) {
- OggPacket* locPacket = inOggPage->getPacket(j);
- if (locPacket->packetSize() > 0) {
- mBufferWriter(locPacket->packetData(),
- locPacket->packetSize(), mBufferWriterUserData);
+
+ case SEEN_ALL_CODEC_HEADERS:
+ {
+ // Only output streams which the user requested
+ for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
+ if ( mWantedStreamSerialNumbers[i].first
+ == inOggPage->header()->StreamSerialNo()) {
+ if (wantOnlyPacketBody(mWantedMIMETypes)) {
+ for (unsigned long j = 0; j < inOggPage->numPackets(); j++) {
+ OggPacket* locPacket = inOggPage->getPacket(j);
+ if (locPacket->packetSize() > 0) {
+ mBufferWriter(locPacket->packetData(),
+ locPacket->packetSize(), mBufferWriterUserData);
+ }
}
+ } else {
+ mBufferWriter(inOggPage->createRawPageData(),
+ inOggPage->pageSize(), mBufferWriterUserData);
}
- } else {
- mBufferWriter(inOggPage->createRawPageData(),
- inOggPage->pageSize(), mBufferWriterUserData);
}
}
}
- }
- break;
- case INVALID:
- break;
- default:
- break;
+ break;
+ case INVALID:
+ break;
+ default:
+ break;
+ }
+
+ } else {
+ // Should never get here!
+ assert(0);
}
if (mDemuxState == INVALID) {
Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h 2005-01-03 09:20:13 UTC (rev 8591)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h 2005-01-03 17:03:19 UTC (rev 8592)
@@ -38,21 +38,28 @@
INVALID = 100,
};
+ enum eDemuxParserState {
+ LOOK_FOR_HEADERS,
+ LOOK_FOR_BODY,
+ };
+
void sendPage(OggPage* inOggPage);
BufferWriter mBufferWriter;
void* mBufferWriterUserData;
+ fstream mDebugFile;
+
string mFilename;
fstream mFile;
- unsigned long mStartOfBodyOffset; // Deprecate?
- unsigned long mRequestedTimeOffset; // Deprecate
unsigned long mAnnodexSerialNumber;
- LOOG_INT64 mRequestedTime;
+ LOOG_INT64 mRequestedTime; // Deprecate
eDemuxState mDemuxState;
+ eDemuxParserState mDemuxParserState;
+
vector<tSerial_HeadCountPair> mWantedStreamSerialNumbers;
const vector<const string>* mWantedMIMETypes;
};
Modified: trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp
===================================================================
--- trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp 2005-01-03 09:20:13 UTC (rev 8591)
+++ trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp 2005-01-03 17:03:19 UTC (rev 8592)
@@ -62,250 +62,9 @@
#include <list>
#include <string>
-#define DEBUG
+#undef DEBUG
-#if 0
-
-#define ANX_MIME_TYPE "application/x-annodex"
-#define CMML_MIME_TYPE "text/x-cmml"
-
-#define CMML_PREAMBLE \
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
-
-#define MOD_ANNODEX_TYPE_UNKNOWN -1
-
-#define MOD_ANNODEX_TYPE_ANX 0
-#define MOD_ANNODEX_TYPE_CMML 1
-
-#define MEDIA_BUF_LEN 8192
-
-
-
-enum eDemuxState {
- SEEN_NOTHING,
- SEEN_ANNODEX_BOS,
- SEEN_ANNODEX_EOS,
- SEEN_ALL_CODEC_HEADERS,
- INVALID = 100
-};
-
-eDemuxState demuxState;
-
-typedef pair<unsigned long, unsigned long> tSerial_HeadCountPair;
-
-unsigned long bytePos;
-
-bool gotAllHeaders;
-
-vector<tSerial_HeadCountPair> theStreams;
-
-unsigned long annodexSerialNo;
-
-using namespace std;
-
-unsigned long headerCount(OggPacket* inPacket)
-{
- const unsigned short NUM_SEC_HEADERS_OFFSET = 24;
-
- return iLE_Math::charArrToULong(inPacket->packetData() +
- NUM_SEC_HEADERS_OFFSET);
-
-}
-
-request_rec *theRequest;
-
-bool writePageToOutputFile(OggPage* inOggPage) {
- // outputFile.write((char*)inOggPage->createRawPageData(), inOggPage->pageSize());
- ap_rwrite((char*)inOggPage->createRawPageData(),
- inOggPage->pageSize(),
- theRequest);
- return true;
-}
-
-//This will be called by the callback
-bool pageCB(OggPage* inOggPage, void *)
-{
-
- bool allEmpty = true;
-
- switch (demuxState) {
-
- case SEEN_NOTHING:
- if ( (inOggPage->numPackets() == 1)
- && (inOggPage->header()->isBOS())
- && (strncmp((char*)inOggPage->getPacket(0)->packetData(), "Annodex\0", 8) == 0)) {
-
- //Advance the state
- demuxState = SEEN_ANNODEX_BOS;
-
- //Remember the annodex streams serial no
- annodexSerialNo = inOggPage->header()->StreamSerialNo();
-
- //Write out the page.
- writePageToOutputFile(inOggPage);
- } else {
-
- demuxState = INVALID;
- }
-
- break;
- case SEEN_ANNODEX_BOS:
- if ( (inOggPage->numPackets() == 1)
- && (inOggPage->header()->isBOS())
- && (strncmp((char*)inOggPage->getPacket(0)->packetData(), "AnxData\0", 8) == 0)) {
-
-
- //Create an association of serial no and num headers
- tSerial_HeadCountPair locMap;
- locMap.first = inOggPage->header()->StreamSerialNo();
- locMap.second = headerCount(inOggPage->getPacket(0));
-
- //Add the association to the list
- theStreams.push_back(locMap);
-
- //Write the page out to the output file.
- writePageToOutputFile(inOggPage);
- } else if ( (inOggPage->header()->isEOS())
- && (inOggPage->header()->StreamSerialNo() == annodexSerialNo)) {
-
- //It's the Annodex EOS.
- demuxState = SEEN_ANNODEX_EOS;
- writePageToOutputFile(inOggPage);
- } else {
- demuxState = INVALID;
- }
- break;
- case SEEN_ANNODEX_EOS:
- for (unsigned int i = 0; i < theStreams.size(); i++) {
- if (theStreams[i].first == inOggPage->header()->StreamSerialNo()) {
- if (theStreams[i].second >= 1) {
- theStreams[i].second--;
- writePageToOutputFile(inOggPage);
- } else {
- demuxState = INVALID;
- }
- }
- }
-
-
- for (unsigned int i = 0; i < theStreams.size(); i++) {
- if (theStreams[i].second != 0) {
- allEmpty = false;
- }
- }
-
- if (allEmpty) {
-
- demuxState = SEEN_ALL_CODEC_HEADERS;
- }
- break;
- case SEEN_ALL_CODEC_HEADERS:
- break;
- case INVALID:
- break;
- default:
- break;
- }
-
-
- if (demuxState == INVALID) {
- }
- // delete inOggPage;
-
- return true;
-}
-
-static int
-ma_anxenc (request_rec * r, char * filename, char * content_type,
- apr_table_t * cgi_table)
-{
- char * val;
- double seek_offset = 0.0;
-
- theRequest = r;
-
- /* put the requested time into seek_offset */
- val = (char *)apr_table_get (cgi_table, "t");
-
- if (!val)
- {
- fstream inputFile;
- inputFile.open(filename, ios_base::in | ios_base::binary);
- for (;;)
- {
- const unsigned short BUFF_SIZE = 8092;
- char* locBuff = new char[BUFF_SIZE];
-
- inputFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = inputFile.gcount();
- if (locBytesRead == 0) break;
- ap_rwrite (locBuff, locBytesRead, r);
- }
- inputFile.close();
-
- return 0;
- }
-
- seek_offset = anx_parse_time (val);
-
- /* begin AnxCutter code */
- demuxState = SEEN_NOTHING;
- bytePos = 0;
- gotAllHeaders = false;
- annodexSerialNo = 0;
-
- OggDataBuffer testOggBuff;
- testOggBuff.registerStaticCallback(&pageCB, NULL);
-
- /* rip out the headers from the file */
-
- fstream inputFile;
-
- ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
- "ma_anxenc t=%s (%ld)\n", val, seek_offset);
-
- inputFile.open(filename, ios_base::in | ios_base::binary);
-
- char* locBuff = new char[MEDIA_BUF_LEN];
- while (demuxState < SEEN_ALL_CODEC_HEADERS) {
- inputFile.read(locBuff, MEDIA_BUF_LEN);
- unsigned long locBytesRead = inputFile.gcount();
- if (locBytesRead > 0)
- {
- ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
- "feeding %ld bytes to testOggBuff", locBytesRead);
- }
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
- inputFile.close();
-
- // Build a seek table for the file
- AutoAnxSeekTable *locSeekTable = new AutoAnxSeekTable(filename);
- locSeekTable->buildTable();
-
- // Seek to the user's requested start time
- LOOG_UINT64 locStartTime = (LOOG_UINT64) seek_offset * 10000000;
- OggSeekTable::tSeekPair locSeekResult = locSeekTable->getStartPos(locStartTime);
-
- // Stream-copy everything from the requested timepoint onward to the output file
- inputFile.open(filename, ios_base::in | ios_base::binary);
- inputFile.seekg(locSeekResult.second);
-
- for (;;) {
- inputFile.read(locBuff, MEDIA_BUF_LEN);
- unsigned long locBytesRead = inputFile.gcount();
- if (locBytesRead == 0) break;
- //outputFile.write(locBuff, locBytesRead);
- ap_rwrite (locBuff, locBytesRead, r);
- }
- inputFile.close();
-
- ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
- "Served request");
-}
-#endif
-
bool isAnnodexFile (string locFilename)
{
string locExtension = locFilename.substr(locFilename.length() - 4);
@@ -432,8 +191,8 @@
locRecomposer->recomposeStreamFrom(locRequestedStartTime, locOutputMIMETypes);
// Clean up
- delete locOutputMIMETypes;
- delete locRecomposer;
+ //delete locOutputMIMETypes;
+ //delete locRecomposer;
return OK;
}
Modified: trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.vcproj
===================================================================
--- trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.vcproj 2005-01-03 09:20:13 UTC (rev 8591)
+++ trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.vcproj 2005-01-03 17:03:19 UTC (rev 8592)
@@ -175,9 +175,6 @@
</Configuration>
</Configurations>
<References>
- <ProjectReference
- ReferencedProjectIdentifier="{3D55194E-6732-4A74-A947-EDFF585A0F19}"
- Name="libOOOggChef"/>
</References>
<Files>
<Filter
More information about the commits
mailing list