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

Commit aa82768b authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Fixing AMR recording code."

parents a5cbed96 259b7c1c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -185,6 +185,11 @@ sp<MediaSource> StagefrightRecorder::createAMRAudioSource() {
            mAudioEncoder == AUDIO_ENCODER_AMR_NB
                ? MEDIA_MIMETYPE_AUDIO_AMR_NB : MEDIA_MIMETYPE_AUDIO_AMR_WB);

    int32_t maxInputSize;
    CHECK(audioSource->getFormat()->findInt32(
                kKeyMaxInputSize, &maxInputSize));

    encMeta->setInt32(kKeyMaxInputSize, maxInputSize);
    encMeta->setInt32(kKeyChannelCount, 1);
    encMeta->setInt32(kKeySampleRate, sampleRate);

+6 −3
Original line number Diff line number Diff line
@@ -173,12 +173,15 @@ void AMRWriter::threadFunc() {
                buffer->range_length(),
                mFile);

        if (n < (ssize_t)buffer->range_length()) {
            buffer->release();
            buffer = NULL;

        if (n < (ssize_t)buffer->range_length()) {
            break;
        }

        buffer->release();
        buffer = NULL;
    }

    Mutex::Autolock autoLock(mLock);