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

Commit a18886ca authored by Chih-Chung Chang's avatar Chih-Chung Chang
Browse files

Fix 5278371: OOM in MediaItemThumbnailTest

Because we request 400x240 thumbnails. 100 thumbnails needs 38M,
which is too much. Change it to 70 now.

Also handle the case if the thumbnail callback throws exception.

Change-Id: Iac4ee72f308b7c7a6ae860983197601cf89bee8f
parent 2295cc77
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2328,6 +2328,10 @@ static int videoEditor_getPixelsList(
            break;
        }
        env->CallVoidMethod(callback, mid, (jint)k);
        if (env->ExceptionCheck()) {
            err = M4ERR_ALLOC;
            break;
        }
    }

    env->ReleaseIntArrayElements(pixelArray, m_dst32, 0);
@@ -2338,7 +2342,7 @@ static int videoEditor_getPixelsList(
        env->ReleaseStringUTFChars(path, pString);
    }

    if (err != M4NO_ERROR) {
    if (err != M4NO_ERROR && !env->ExceptionCheck()) {
        jniThrowException(env, "java/lang/RuntimeException",\
                "ThumbnailGetPixels32 failed");
    }
+1 −1
Original line number Diff line number Diff line
@@ -657,7 +657,7 @@ public class MediaItemThumbnailTest extends
    public void testThumbnailListForH264WVGAWithCount() throws Exception {
        final String videoItemFilename = INPUT_FILE_PATH +
            "H264_BP_800x480_15fps_512kbps_AACLC_24KHz_38Kbps_s_1_17.mp4";
        final int tnCount = 100;
        final int tnCount = 70;
        final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
        final MediaVideoItem mediaVideoItem =
            mVideoEditorHelper.createMediaItem(mVideoEditor, "m1",