When I read a binary mkv the id of a cluster is E7 byte and the timestamp has an unsigned int value but when I read it id doesn't give me the correct timestamp.
double mkVSParser::get_clusters_timestamps(char *&package,unsigned long &size)
{
uint8_t *data_to_find = new uint8_t;
*data_to_find=0xE7;//the id
char * buffer = new char[sizeof (uint8_t)];
uint8_t current_data[sizeof (uint8_t)];
for(int i=0;i<size;i++)//finde the first 0xE7 in an cluster
{
memcpy(&buffer[0],&package[i],sizeof (uint8_t));
memcpy(¤t_data[0],buffer,sizeof (uint8_t));
if (memcmp(data_to_find, current_data, sizeof (uint8_t)) == 0)
{
unsigned int timestemp;
std::cout<<"position of byte =="<<i<<"and id =="<<(unsigned int)package[i]<<std::endl;
memcpy(×temp,&package[i+1],sizeof(unsigned int));
std::cout<<"cluster timestemp ="<<timestemp<<std::endl;
return 0;
}
}
return 0;
}
Is there something that I missed?