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

Commit 1d8a3644 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Camera: fix NDK logspam" into rvc-dev am: 10b16117

Change-Id: I8a687efa39e25194131696fe27ba929be4374fc5
parents d9d0c1b4 10b16117
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -139,12 +139,20 @@ ACameraMetadata::filterDurations(uint32_t tag) {
    const int STREAM_WIDTH_OFFSET = 1;
    const int STREAM_WIDTH_OFFSET = 1;
    const int STREAM_HEIGHT_OFFSET = 2;
    const int STREAM_HEIGHT_OFFSET = 2;
    const int STREAM_DURATION_OFFSET = 3;
    const int STREAM_DURATION_OFFSET = 3;

    camera_metadata_entry entry = mData->find(tag);
    camera_metadata_entry entry = mData->find(tag);
    if (entry.count == 0 || entry.count % 4 || entry.type != TYPE_INT64) {

    if (entry.count == 0) {
        // Duration keys can be missing when corresponding capture feature is not supported
        return;
    }

    if (entry.count % 4 || entry.type != TYPE_INT64) {
        ALOGE("%s: malformed duration key %d! count %zu, type %d",
        ALOGE("%s: malformed duration key %d! count %zu, type %d",
                __FUNCTION__, tag, entry.count, entry.type);
                __FUNCTION__, tag, entry.count, entry.type);
        return;
        return;
    }
    }

    Vector<int64_t> filteredDurations;
    Vector<int64_t> filteredDurations;
    filteredDurations.setCapacity(entry.count * 2);
    filteredDurations.setCapacity(entry.count * 2);