/*---------------------------------------------------------------------- | AP4_BytesToDoubleBE +---------------------------------------------------------------------*/ double AP4_BytesToDoubleBE(const unsigned char* bytes) { AP4_UI64 i_value = AP4_BytesToUInt64BE(bytes); void* v_value = reinterpret_cast<void*>(&i_value); double* d_value = reinterpret_cast<double*>(v_value); return *d_value; }
/*---------------------------------------------------------------------- | AP4_ByteStream::ReadUI64 +---------------------------------------------------------------------*/ AP4_Result AP4_ByteStream::ReadUI64(AP4_UI64& value) { unsigned char buffer[8]; // read bytes from the stream AP4_Result result; result = Read((void*)buffer, 8); if (AP4_FAILED(result)) { value = 0; return result; } // convert bytes to value value = AP4_BytesToUInt64BE(buffer); return AP4_SUCCESS; }