status_t CameraService::Client::startRecording()
{
if (mMediaPlayerBeep.get() != NULL) {
+ mMediaPlayerBeep->seekTo(0);
mMediaPlayerBeep->start();
}
return startCameraMode(CAMERA_RECORDING_MODE);
}
if (mMediaPlayerBeep.get() != NULL) {
+ mMediaPlayerBeep->seekTo(0);
mMediaPlayerBeep->start();
}
mHardware->stopRecording();
// Play shutter sound.
if (client->mMediaPlayerClick.get() != NULL) {
+ client->mMediaPlayerClick->seekTo(0);
client->mMediaPlayerClick->start();
}
status_t MediaPlayer::seekTo(int msec)
{
+ mLockThreadId = getThreadId();
Mutex::Autolock _l(mLock);
- return seekTo_l(msec);
+ status_t result = seekTo_l(msec);
+ mLockThreadId = 0;
+
+ return result;
}
status_t MediaPlayer::reset()
// this will deadlock.
//
// The threadId hack below works around this for the care of prepare
- // within the same process.
-
+ // and seekTo within the same process.
+ // FIXME: Remember, this is a hack, it's not even a hack that is applied
+ // consistently for all use-cases, this needs to be revisited.
if (mLockThreadId != getThreadId()) {
mLock.lock();
locked = true;