diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 59977faf2..d696020bb 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -1321,6 +1321,7 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32 mSyncSlave(false), mQueueSounds(false), mPlayedOnce(false), + mCorrupted(false), mType(type), // mSourceID(source_id), @@ -1372,16 +1373,25 @@ void LLAudioSource::setChannel(LLAudioChannel *channelp) void LLAudioSource::update() { + if(mCorrupted) + { + return ; //no need to update + } + if (!getCurrentBuffer()) { if (getCurrentData()) { // Hack - try and load the sound. Will do this as a callback // on decode later. - if (getCurrentData()->load()) + if (getCurrentData()->load() && getCurrentData()->getBuffer()) { play(getCurrentData()->getID()); - } + } + else + { + mCorrupted = true ; + } } } } @@ -1502,6 +1512,11 @@ bool LLAudioSource::play(const LLUUID &audio_uuid) bool LLAudioSource::isDone() const { + if(mCorrupted) + { + return true ; + } + const F32 MAX_AGE = 60.f; const F32 MAX_UNPLAYED_AGE = 15.f; const F32 MAX_MUTED_AGE = 11.f; @@ -1817,7 +1832,7 @@ LLAudioData::LLAudioData(const LLUUID &uuid) : } } - +//return false when the audio file is corrupted. bool LLAudioData::load() { // For now, just assume we're going to use one buffer per audiodata. @@ -1833,7 +1848,7 @@ bool LLAudioData::load() { // No free buffers, abort. llinfos << "Not able to allocate a new audio buffer, aborting." << llendl; - return false; + return true; } std::string uuid_str; diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 0edaff884..254a1ee1f 100644 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -366,6 +366,7 @@ protected: bool mSyncSlave; bool mQueueSounds; bool mPlayedOnce; + bool mCorrupted; S32 mType; LLVector3d mPositionGlobal; LLVector3 mVelocity; diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index edb882de0..db6e02ca2 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -833,11 +833,21 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */ if (! src) goto err; - do + while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0) { - bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE,src); - gzwrite(dst, buffer, bytes); - } while(feof(src) == 0); + if (gzwrite(dst, buffer, bytes) <= 0) + { + llwarns << "gzwrite failed: " << gzerror(dst, NULL) << llendl; + goto err; + } + } + + if (ferror(src)) + { + llwarns << "Error reading " << srcfile << llendl; + goto err; + } + gzclose(dst); dst = NULL; #if LL_WINDOWS diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 2b783881e..1096d9b7a 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -3235,7 +3235,7 @@ void LLViewerLODTexture::processTextureStats() scaleDown() ; } // Limit the amount of GL memory bound each frame - if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale && + else if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale && (!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel)) { scaleDown() ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 041716435..442e78857 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -558,6 +558,7 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) S32 count = mImageList.erase(image) ; if(count != 1) { + llinfos << image->getID() << llendl ; llerrs << "Error happens when remove image from mImageList: " << count << llendl ; } @@ -956,6 +957,8 @@ void LLViewerTextureList::decodeAllImages(F32 max_time) image_list.push_back(imagep); imagep->setInImageList(FALSE) ; } + + llassert_always(image_list.size() == mImageList.size()) ; mImageList.clear(); for (std::vector >::iterator iter = image_list.begin(); iter != image_list.end(); ++iter) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a45023005..ada92721d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -634,7 +634,9 @@ public: addText(xpos, ypos, llformat("%d/%d Mesh HTTP Requests/Retries", LLMeshRepository::sHTTPRequestCount, LLMeshRepository::sHTTPRetryCount)); - + ypos += y_inc; + + addText(xpos, ypos, llformat("%d/%d Mesh LOD Pending/Processing", LLMeshRepository::sLODPending, LLMeshRepository::sLODProcessing)); ypos += y_inc; addText(xpos, ypos, llformat("%.3f/%.3f MB Mesh Cache Read/Write ", LLMeshRepository::sCacheBytesRead/(1024.f*1024.f), LLMeshRepository::sCacheBytesWritten/(1024.f*1024.f))); @@ -1070,7 +1072,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask mWindow->showCursorFromMouseMove(); - if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME) + if (gAwayTimer.getElapsedTimeF32() > MIN_AFK_TIME + && !gDisconnected) { gAgent.clearAFK(); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4ac8ffce1..ae799ca1d 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -84,6 +84,8 @@ class LLVOAvatar : public LLViewerObject, public LLCharacter { + LOG_CLASS(LLVOAvatar); + public: friend class LLVOAvatarSelf; protected: diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 24ee48517..d8e1187cb 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -39,6 +39,7 @@ class LLVOAvatarSelf : public LLVOAvatar { + LOG_CLASS(LLVOAvatarSelf); /******************************************************************************** ** ** diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index df0925c6c..d487567b1 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4244,6 +4244,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } } else if (gPipeline.canUseVertexShaders() + && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD && LLPipeline::sRenderBump && te->getShiny()) { //shiny diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 535beb3ad..2648b537a 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -71,7 +71,7 @@ struct LLWearableArrivedData LLWearableList::~LLWearableList() { - llassert_always(mList.empty()) ; + cleanup(); } void LLWearableList::cleanup() diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 828013b07..159255078 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -227,6 +227,16 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) mCurlRequest = new LLCurlEasyRequest(); } + if(!mCurlRequest->isValid()) + { + llwarns << "mCurlRequest is invalid." << llendl ; + + delete mCurlRequest ; + mCurlRequest = NULL ; + return ; + } + + LLProxy::getInstance()->applyProxySettings(mCurlRequest); // mCurlRequest->setopt(CURLOPT_VERBOSE, 1); // usefull for debugging @@ -277,10 +287,20 @@ LLXMLRPCTransaction::Impl::~Impl() } delete mCurlRequest; + mCurlRequest = NULL ; } bool LLXMLRPCTransaction::Impl::process() { + if(!mCurlRequest || !mCurlRequest->isValid()) + { + llwarns << "transaction failed." << llendl ; + + delete mCurlRequest ; + mCurlRequest = NULL ; + return true ; //failed, quit. + } + switch(mStatus) { case LLXMLRPCTransaction::StatusComplete: diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3c113c0ac..4b5a073b3 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1021,10 +1021,12 @@ void LLPipeline::restoreGL() BOOL LLPipeline::canUseVertexShaders() { + static const std::string vertex_shader_enable_feature_string = "VertexShaderEnable"; + if (sDisableShaders || !gGLManager.mHasVertexShader || !gGLManager.mHasFragmentShader || - !LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") || + !LLFeatureManager::getInstance()->isFeatureAvailable(vertex_shader_enable_feature_string) || (assertInitialized() && mVertexShadersLoaded != 1) ) { return FALSE; @@ -5085,7 +5087,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) light_state->setSpotCutoff(90.f); light_state->setSpotExponent(2.f); - light_state->setSpecular(LLColor4::black); + const LLColor4 specular(0.f, 0.f, 0.f, 0.f); + light_state->setSpecular(specular); } else // omnidirectional (point) light {