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

Commit 467743d4 authored by Hangyu Kuang's avatar Hangyu Kuang
Browse files

media: Use width and height when dispWidth and dispHeight are not present.

Test: Test the NativeDecode cts test and manual do camera recording.
Bug:34213028
Change-Id: Ide354d3d9ce4e4bc33cbc7821fa31471b756ec78
parent 5a3b54df
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3260,8 +3260,14 @@ void MPEG4Writer::Track::writeTkhdBox(uint32_t now) {
        mOwner->writeInt32(0);
    } else {
        int32_t width, height;
        bool success = mMeta->findInt32(kKeyWidth, &width);
        bool success = mMeta->findInt32(kKeyDisplayWidth, &width);
        success = success && mMeta->findInt32(kKeyDisplayHeight, &height);

        // Use width/height if display width/height are not present.
        if (!success) {
            success = mMeta->findInt32(kKeyWidth, &width);
            success = success && mMeta->findInt32(kKeyHeight, &height);
        }
        CHECK(success);

        mOwner->writeInt32(width << 16);   // 32-bit fixed-point value