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

Commit ef0cf503 authored by Chong Zhang's avatar Chong Zhang
Browse files

Log an error when audio/video encoder failed to create

Change-Id: I493981cddeb9452c533e2917d8c440897d5e6b49
related-to-bug: 15106730
parent 31dcd338
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -932,6 +932,10 @@ sp<MediaSource> StagefrightRecorder::createAudioSource() {
            MediaCodecSource::Create(mLooper, format, audioSource);
    mAudioSourceNode = audioSource;

    if (audioEncoder == NULL) {
        ALOGE("Failed to create audio encoder");
    }

    return audioEncoder;
}

@@ -1487,7 +1491,7 @@ status_t StagefrightRecorder::setupVideoEncoder(
    sp<MediaCodecSource> encoder =
            MediaCodecSource::Create(mLooper, format, cameraSource, flags);
    if (encoder == NULL) {
        ALOGW("Failed to create the encoder");
        ALOGE("Failed to create video encoder");
        // When the encoder fails to be created, we need
        // release the camera source due to the camera's lock
        // and unlock mechanism.