Loading media/libstagefright/NuCachedSource2.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -254,6 +254,10 @@ void NuCachedSource2::disconnect() { // set mDisconnecting to true, if a fetch returns after // this, the source will be marked as EOS. mDisconnecting = true; // explicitly signal mCondition so that the pending readAt() // will immediately return mCondition.signal(); } // explicitly disconnect from the source, to allow any Loading Loading @@ -325,7 +329,11 @@ void NuCachedSource2::fetchInternal() { Mutex::Autolock autoLock(mLock); if (err == ERROR_UNSUPPORTED || err == -EPIPE) { if (mDisconnecting) { mNumRetriesLeft = 0; mFinalStatus = ERROR_END_OF_STREAM; return; } else if (err == ERROR_UNSUPPORTED || err == -EPIPE) { // These are errors that are not likely to go away even if we // retry, i.e. the server doesn't support range requests or similar. mNumRetriesLeft = 0; Loading Loading @@ -515,10 +523,14 @@ ssize_t NuCachedSource2::readAt(off64_t offset, void *data, size_t size) { CHECK(mAsyncResult == NULL); msg->post(); while (mAsyncResult == NULL) { while (mAsyncResult == NULL && !mDisconnecting) { mCondition.wait(mLock); } if (mDisconnecting) { return ERROR_END_OF_STREAM; } int32_t result; CHECK(mAsyncResult->findInt32("result", &result)); Loading Loading
media/libstagefright/NuCachedSource2.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -254,6 +254,10 @@ void NuCachedSource2::disconnect() { // set mDisconnecting to true, if a fetch returns after // this, the source will be marked as EOS. mDisconnecting = true; // explicitly signal mCondition so that the pending readAt() // will immediately return mCondition.signal(); } // explicitly disconnect from the source, to allow any Loading Loading @@ -325,7 +329,11 @@ void NuCachedSource2::fetchInternal() { Mutex::Autolock autoLock(mLock); if (err == ERROR_UNSUPPORTED || err == -EPIPE) { if (mDisconnecting) { mNumRetriesLeft = 0; mFinalStatus = ERROR_END_OF_STREAM; return; } else if (err == ERROR_UNSUPPORTED || err == -EPIPE) { // These are errors that are not likely to go away even if we // retry, i.e. the server doesn't support range requests or similar. mNumRetriesLeft = 0; Loading Loading @@ -515,10 +523,14 @@ ssize_t NuCachedSource2::readAt(off64_t offset, void *data, size_t size) { CHECK(mAsyncResult == NULL); msg->post(); while (mAsyncResult == NULL) { while (mAsyncResult == NULL && !mDisconnecting) { mCondition.wait(mLock); } if (mDisconnecting) { return ERROR_END_OF_STREAM; } int32_t result; CHECK(mAsyncResult->findInt32("result", &result)); Loading