summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
diff options
context:
space:
mode:
authorRaghavender Palla <rpalla@google.com>2011-03-18 22:32:51 -0700
committerRaghavender Palla <rpalla@google.com>2011-03-21 21:59:15 -0700
commitfa31daff175709d2c58d61d1354daa9495696631 (patch)
treee1154f7b3d9a1af38571eb655f5373dd2de4329d /libvideoeditor/lvpp/VideoEditorPreviewController.cpp
parentebf40154a222c864a0aaf807702fc4eb6b9cf40f (diff)
downloadframeworks_av-fa31daff175709d2c58d61d1354daa9495696631.zip
frameworks_av-fa31daff175709d2c58d61d1354daa9495696631.tar.gz
frameworks_av-fa31daff175709d2c58d61d1354daa9495696631.tar.bz2
Fix for the issue: TestPreviewWithTransition fails (4133108)
Change-Id: I53eb798f4f86e83f8a4668c7256241367c1ccbe4
Diffstat (limited to 'libvideoeditor/lvpp/VideoEditorPreviewController.cpp')
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorPreviewController.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
index 3e3d161..2e2ae22 100755
--- a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
+++ b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
@@ -681,10 +681,15 @@ M4OSA_UInt32 VideoEditorPreviewController::stopPreview() {
// Return the last rendered frame time stamp
mVePlayer[mActivePlayerIndex]->getLastRenderedTimeMs(&lastRenderedFrameTimeMs);
}
-
- LOGV("stopPreview: clearing mVePlayer");
- mVePlayer[playerInst].clear();
+
+ //This is used to syncronize onStreamDone() in PreviewPlayer and
+ //stopPreview() in PreviewController
+ sp<VideoEditorPlayer> temp = mVePlayer[playerInst];
+ temp->acquireLock();
+ LOGV("stopPreview: clearing mVePlayer");
+ mVePlayer[playerInst].clear();
mVePlayer[playerInst] = NULL;
+ temp->releaseLock();
}
}
LOGV("stopPreview: clear audioSink and audioPlayer");
@@ -1124,7 +1129,7 @@ M4OSA_ERR VideoEditorPreviewController::threadProc(M4OSA_Void* param) {
}
}
LOGV("threadProc: sem wait returned err = 0x%x", err);
- }
+ }
//Always return M4NO_ERROR to ensure the thread keeps running
return M4NO_ERROR;
@@ -1186,7 +1191,8 @@ void VideoEditorPreviewController::notify(
{
Mutex::Autolock autoLock(pController->mLockSem);
if (pController->mSemThreadWait != NULL) {
- M4OSA_semaphorePost(pController->mSemThreadWait);
+ M4OSA_semaphorePost(pController->mSemThreadWait);
+ return;
}
}