Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9a7dc27 authored by Kyle Zhang's avatar Kyle Zhang Committed by Gerrit Code Review
Browse files

Merge "libmediadrm logging: avoid unaligned memory"

parents 1cca540f e47b6886
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <deque>
#include <endian.h>
@@ -92,7 +93,8 @@ void LogToBuffer(android_LogPriority level, const char *fmt, Args... args) {

template <typename... Args>
void LogToBuffer(android_LogPriority level, const uint8_t uuid[16], const char *fmt, Args... args) {
    const uint64_t* uuid2 = reinterpret_cast<const uint64_t*>(uuid);
    uint64_t uuid2[2] = {};
    std::memcpy(uuid2, uuid, sizeof(uuid2));
    std::string uuidFmt("uuid=[%lx %lx] ");
    uuidFmt += fmt;
    LogToBuffer(level, uuidFmt.c_str(), htobe64(uuid2[0]), htobe64(uuid2[1]), args...);