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

Commit 3d780919 authored by Chih-Yu Huang's avatar Chih-Yu Huang Committed by Chih-yu Huang
Browse files

C2SoftFlacEnc: Avoid mapping C2LinearBlock twice

C2LinearBlock can be mapped to C2WriteView at most once at the same
time. This CL eliminates a local C2WriteView which is used to check
the status of C2LinearBlock, to avoid mapping C2LinearBlock twice.

Bug: 168052467
Test: android.media.cts.MediaCodecTest#testFlacIdentity

Change-Id: Ie798eac9979d867fa5c398cb3f3960341569c63d
(cherry picked from commit 96e1e1c22c50e49228ead2bfe1ec5186f5570c04)
parent e7350052
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -262,9 +262,10 @@ void C2SoftFlacEnc::process(
        work->result = C2_NO_MEMORY;
        return;
    }
    C2WriteView wView = mOutputBlock->map().get();
    if (wView.error()) {
        ALOGE("write view map failed %d", wView.error());

    err = mOutputBlock->map().get().error();
    if (err) {
        ALOGE("write view map failed %d", err);
        work->result = C2_CORRUPTED;
        return;
    }