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

Commit 1179bc9b authored by The Android Open Source Project's avatar The Android Open Source Project
Browse files

auto import from //branches/cupcake_rel/...@140373

parent c048cae0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -104,7 +104,8 @@ enum media_recorder_error_type {
// 
enum media_recorder_info_type {
    MEDIA_RECORDER_INFO_UNKNOWN                   = 1,
    MEDIA_RECORDER_INFO_MAX_DURATION_REACHED      = 800
    MEDIA_RECORDER_INFO_MAX_DURATION_REACHED      = 800,
    MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED      = 801
};

// ----------------------------------------------------------------------------
+2 −1
Original line number Diff line number Diff line
@@ -64,7 +64,8 @@ struct audio_track_cblk_t
                uint16_t    waitTimeMs;      // Cumulated wait time
                // Padding ensuring that data buffer starts on a cache line boundary (32 bytes). 
                // See AudioFlinger::TrackBase constructor
                int32_t     Padding[3];
                int32_t     Padding[1];
                // Cache line boundary
                
                            audio_track_cblk_t();
                uint32_t    stepUser(uint32_t frameCount);
+1 −3
Original line number Diff line number Diff line
@@ -387,12 +387,10 @@ void AudioTrack::flush()
    LOGV("flush");

    if (!mActive) {
        mCblk->lock.lock();
        mAudioTrack->flush();
        // Release AudioTrack callback thread in case it was waiting for new buffers
        // in AudioTrack::obtainBuffer()
        mCblk->cv.signal();
        mCblk->lock.unlock();
    }
}

@@ -443,7 +441,7 @@ void AudioTrack::setSampleRate(int rate)
    if (rate > afSamplingRate*2) rate = afSamplingRate*2;
    if (rate > MAX_SAMPLE_RATE) rate = MAX_SAMPLE_RATE;

    mCblk->sampleRate = rate;
    mCblk->sampleRate = (uint16_t)rate;
}

uint32_t AudioTrack::getSampleRate()
+11 −1
Original line number Diff line number Diff line
@@ -194,8 +194,15 @@ int JetPlayer::render() {
    }

   while (1) {
    
        mMutex.lock(); // [[[[[[[[ LOCK ---------------------------------------

        if (mEasData == NULL) {
            mMutex.unlock();
            LOGV("JetPlayer::render(): NULL EAS data, exiting render.");
            goto threadExit;
        }
            
        // nothing to render, wait for client thread to wake us up
        while (!mRender)
        {
@@ -255,7 +262,10 @@ int JetPlayer::render() {
    }//while (1)

threadExit:
    if (mAudioTrack) {
        mAudioTrack->stop();
        mAudioTrack->flush();
    }
    if (mAudioBuffer) {
        delete [] mAudioBuffer;
        mAudioBuffer = NULL;
+3 −2
Original line number Diff line number Diff line
@@ -367,8 +367,9 @@ status_t MediaRecorder::setParameters(const String8& params) {
    status_t ret = mMediaRecorder->setParameters(params);
    if (OK != ret) {
        LOGE("setParameters(%s) failed: %d", params.string(), ret);
        mCurrentState = MEDIA_RECORDER_ERROR;
        return ret;
        // Do not change our current state to MEDIA_RECORDER_ERROR, failures
        // of the only currently supported parameters, "max-duration" and
        // "max-filesize" are _not_ fatal.
    }

    return ret;