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

Commit 0434852b authored by Andy McFadden's avatar Andy McFadden Committed by Android Git Automerger
Browse files

am cfca686a: Merge "Rotate fallback size" into klp-dev

* commit 'cfca686a':
  Rotate fallback size
parents f572b3f1 cfca686a
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -464,12 +464,16 @@ static status_t recordScreen(const char* fileName) {
    err = prepareEncoder(mainDpyInfo.fps, &encoder, &bufferProducer);

    if (err != NO_ERROR && !gSizeSpecified) {
        if (gVideoWidth != kFallbackWidth && gVideoHeight != kFallbackHeight) {
        // fallback is defined for landscape; swap if we're in portrait
        bool needSwap = gVideoWidth < gVideoHeight;
        uint32_t newWidth = needSwap ? kFallbackHeight : kFallbackWidth;
        uint32_t newHeight = needSwap ? kFallbackWidth : kFallbackHeight;
        if (gVideoWidth != newWidth && gVideoHeight != newHeight) {
            ALOGV("Retrying with 720p");
            fprintf(stderr, "WARNING: failed at %dx%d, retrying at 720p\n",
                    gVideoWidth, gVideoHeight);
            gVideoWidth = kFallbackWidth;
            gVideoHeight = kFallbackHeight;
            fprintf(stderr, "WARNING: failed at %dx%d, retrying at %dx%d\n",
                    gVideoWidth, gVideoHeight, newWidth, newHeight);
            gVideoWidth = newWidth;
            gVideoHeight = newHeight;
            err = prepareEncoder(mainDpyInfo.fps, &encoder, &bufferProducer);
        }
    }