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

Commit 259b7c1c authored by Andreas Huber's avatar Andreas Huber
Browse files

Fixing AMR recording code.

parent f67119bc
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);