* fixed item 141 and added GetVersion()

Change-Id: I4a54b66f8c781150e41845b0a62e42ad376e53a4
This commit is contained in:
Hwasoo Lee
2010-07-19 13:56:30 -04:00
parent a4007c1dc9
commit 4243c5dc20
3 changed files with 19 additions and 3 deletions

View File

@@ -15,6 +15,15 @@ mkvparser::IMkvReader::~IMkvReader()
{ {
} }
void mkvparser::GetVersion(int& major, int& minor, int& build, int& revision)
{
major = 1;
minor = 0;
build = 0;
revision = 1;
return;
}
long long mkvparser::ReadUInt(IMkvReader* pReader, long long pos, long& len) long long mkvparser::ReadUInt(IMkvReader* pReader, long long pos, long& len)
{ {
assert(pReader); assert(pReader);
@@ -1202,12 +1211,13 @@ long Segment::Load()
if (id == 0x0F43B675) // Cluster ID if (id == 0x0F43B675) // Cluster ID
{ {
assert(fileposition_of_clusters); assert(fileposition_of_clusters);
if (m_clusterCount > size_of_cluster_pos) if (m_clusterCount >= size_of_cluster_pos)
{ {
size_of_cluster_pos *= 2; size_of_cluster_pos *= 2;
long long* const temp = new long long[size_of_cluster_pos]; long long* const temp = new long long[size_of_cluster_pos];
memset(temp, 0, size_of_cluster_pos); memset(temp, 0, sizeof(long long) * size_of_cluster_pos);
memcpy(temp, fileposition_of_clusters, size_of_cluster_pos); memcpy(temp, fileposition_of_clusters, sizeof(long long) \
* m_clusterCount);
delete [] fileposition_of_clusters; delete [] fileposition_of_clusters;
fileposition_of_clusters = temp; fileposition_of_clusters = temp;
} }

View File

@@ -41,6 +41,7 @@ bool Match(IMkvReader*, long long&, unsigned long,unsigned char*&, size_t&);
bool Match(IMkvReader*, long long&, unsigned long, double&); bool Match(IMkvReader*, long long&, unsigned long, double&);
bool Match(IMkvReader*, long long&, unsigned long, short&); bool Match(IMkvReader*, long long&, unsigned long, short&);
void GetVersion(int& major, int& minor, int& build, int& revision);
struct EBMLHeader struct EBMLHeader
{ {

View File

@@ -56,6 +56,11 @@ int main(int argc, char* argv[])
return -1; return -1;
} }
int major, minor, build, revision;
GetVersion(major, minor, build, revision);
printf("\t\t libmkv verison: %d.%d.%d.%d\n", major, minor, build, revision);
long long pos = 0; long long pos = 0;
EBMLHeader ebmlHeader; EBMLHeader ebmlHeader;