// parse information, // should throw exception on error? // (cannot continue where expected to..) bool XpkTags::ParseChunks(CIOBuffer *pBuffer) { Clear(); // should make new instance of this instead.. // read&parse file header if (ReadStreamHeader(*pBuffer) == false) { return false; } // read chunks from file ReadChunks(*pBuffer); return true; }
unsigned int ElementaryStream::ReadPacketPayload(uint8_t *dst, unsigned int to_read) { // // Allow for the possibility that stream sub-headers might be needed // E.g. AC3, LPCM, DTS.... unsigned int header_size = StreamHeaderSize(); bitcount_t read_start = bs.GetBytePos(); unsigned int actually_read = bs.GetBytes( dst+header_size, to_read-header_size ); bs.Flush( read_start ); Muxed( actually_read ); ReadStreamHeader(dst, header_size); return actually_read; }
// used to check and parse file metadata // to detect support file // -> don't throw exception if invalid file? bool XpkTags::ParseHeader(CIOBuffer *pBuffer) { // read&parse file header return ReadStreamHeader(*pBuffer); }