Loading media/libstagefright/AwesomePlayer.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -444,6 +444,8 @@ void AwesomePlayer::onBufferingUpdate() { notifyListener_l(MEDIA_BUFFERING_UPDATE, percentage * 100.0); notifyListener_l(MEDIA_BUFFERING_UPDATE, percentage * 100.0); postBufferingEvent_l(); postBufferingEvent_l(); } else { LOGE("Not sending buffering status because duration is unknown."); } } } } Loading Loading @@ -552,8 +554,6 @@ status_t AwesomePlayer::play_l() { seekAudioIfNecessary_l(); seekAudioIfNecessary_l(); } } postBufferingEvent_l(); if (mFlags & AT_EOS) { if (mFlags & AT_EOS) { // Legacy behaviour, if a stream finishes playing and then // Legacy behaviour, if a stream finishes playing and then // is started again, we play from the start... // is started again, we play from the start... Loading Loading @@ -1230,6 +1230,8 @@ void AwesomePlayer::onPrepareAsyncEvent() { mFlags |= PREPARED; mFlags |= PREPARED; mAsyncPrepareEvent = NULL; mAsyncPrepareEvent = NULL; mPreparedCondition.broadcast(); mPreparedCondition.broadcast(); postBufferingEvent_l(); } } status_t AwesomePlayer::suspend() { status_t AwesomePlayer::suspend() { Loading media/libstagefright/codecs/aacdec/AACDecoder.cpp +19 −12 Original line number Original line Diff line number Diff line Loading @@ -203,18 +203,24 @@ status_t AACDecoder::read( Int decoderErr = PVMP4AudioDecodeFrame(mConfig, mDecoderBuf); Int decoderErr = PVMP4AudioDecodeFrame(mConfig, mDecoderBuf); size_t numOutBytes = mConfig->frameLength * sizeof(int16_t) * mConfig->desiredChannels; if (decoderErr != MP4AUDEC_SUCCESS) { if (decoderErr != MP4AUDEC_SUCCESS) { LOGE("AAC decoder returned error %d", decoderErr); LOGW("AAC decoder returned error %d, substituting silence", decoderErr); buffer->release(); memset(buffer->data(), 0, numOutBytes); buffer = NULL; return ERROR_MALFORMED; // Discard input buffer. mInputBuffer->release(); mInputBuffer = NULL; // fall through } } buffer->set_range( buffer->set_range(0, numOutBytes); 0, mConfig->frameLength * sizeof(int16_t) * mConfig->desiredChannels); if (mInputBuffer != NULL) { mInputBuffer->set_range( mInputBuffer->set_range( mInputBuffer->range_offset() + mConfig->inputBufferUsedLength, mInputBuffer->range_offset() + mConfig->inputBufferUsedLength, mInputBuffer->range_length() - mConfig->inputBufferUsedLength); mInputBuffer->range_length() - mConfig->inputBufferUsedLength); Loading @@ -223,6 +229,7 @@ status_t AACDecoder::read( mInputBuffer->release(); mInputBuffer->release(); mInputBuffer = NULL; mInputBuffer = NULL; } } } buffer->meta_data()->setInt64( buffer->meta_data()->setInt64( kKeyTime, kKeyTime, Loading Loading
media/libstagefright/AwesomePlayer.cpp +4 −2 Original line number Original line Diff line number Diff line Loading @@ -444,6 +444,8 @@ void AwesomePlayer::onBufferingUpdate() { notifyListener_l(MEDIA_BUFFERING_UPDATE, percentage * 100.0); notifyListener_l(MEDIA_BUFFERING_UPDATE, percentage * 100.0); postBufferingEvent_l(); postBufferingEvent_l(); } else { LOGE("Not sending buffering status because duration is unknown."); } } } } Loading Loading @@ -552,8 +554,6 @@ status_t AwesomePlayer::play_l() { seekAudioIfNecessary_l(); seekAudioIfNecessary_l(); } } postBufferingEvent_l(); if (mFlags & AT_EOS) { if (mFlags & AT_EOS) { // Legacy behaviour, if a stream finishes playing and then // Legacy behaviour, if a stream finishes playing and then // is started again, we play from the start... // is started again, we play from the start... Loading Loading @@ -1230,6 +1230,8 @@ void AwesomePlayer::onPrepareAsyncEvent() { mFlags |= PREPARED; mFlags |= PREPARED; mAsyncPrepareEvent = NULL; mAsyncPrepareEvent = NULL; mPreparedCondition.broadcast(); mPreparedCondition.broadcast(); postBufferingEvent_l(); } } status_t AwesomePlayer::suspend() { status_t AwesomePlayer::suspend() { Loading
media/libstagefright/codecs/aacdec/AACDecoder.cpp +19 −12 Original line number Original line Diff line number Diff line Loading @@ -203,18 +203,24 @@ status_t AACDecoder::read( Int decoderErr = PVMP4AudioDecodeFrame(mConfig, mDecoderBuf); Int decoderErr = PVMP4AudioDecodeFrame(mConfig, mDecoderBuf); size_t numOutBytes = mConfig->frameLength * sizeof(int16_t) * mConfig->desiredChannels; if (decoderErr != MP4AUDEC_SUCCESS) { if (decoderErr != MP4AUDEC_SUCCESS) { LOGE("AAC decoder returned error %d", decoderErr); LOGW("AAC decoder returned error %d, substituting silence", decoderErr); buffer->release(); memset(buffer->data(), 0, numOutBytes); buffer = NULL; return ERROR_MALFORMED; // Discard input buffer. mInputBuffer->release(); mInputBuffer = NULL; // fall through } } buffer->set_range( buffer->set_range(0, numOutBytes); 0, mConfig->frameLength * sizeof(int16_t) * mConfig->desiredChannels); if (mInputBuffer != NULL) { mInputBuffer->set_range( mInputBuffer->set_range( mInputBuffer->range_offset() + mConfig->inputBufferUsedLength, mInputBuffer->range_offset() + mConfig->inputBufferUsedLength, mInputBuffer->range_length() - mConfig->inputBufferUsedLength); mInputBuffer->range_length() - mConfig->inputBufferUsedLength); Loading @@ -223,6 +229,7 @@ status_t AACDecoder::read( mInputBuffer->release(); mInputBuffer->release(); mInputBuffer = NULL; mInputBuffer = NULL; } } } buffer->meta_data()->setInt64( buffer->meta_data()->setInt64( kKeyTime, kKeyTime, Loading