// logfile = fopen(fileName, "a");
// logfile = fopen(stdout, "a");
logfile = stdout;
+// logfile = fopen("/log", "a");
+
if (logfile) return 1;
else return 0;
}
int Player::play()
{
lock();
- return playInt();
-// unLock(); - let thread unlock this
+ bool doUnlock = false;
+ int result = playInt(&doUnlock);
+ if (doUnlock) unLock();
+ return result;
}
void Player::stop()
// ----------------------------------- Implementations called events
-int Player::playInt()
+int Player::playInt(bool* doUnlock)
{
if (!initted) return 0;
if (paused)
{
togglePauseInt();
+ *doUnlock = true;
return 1;
}
return 1;
}
+ // If we are already playing, ignore. no resyncing to do now!
+ if (playing)
+ {
+ *doUnlock = true;
+ return 1;
+ }
+
// Standard play start
logger->log("Player", Log::DEBUG, "Standard play start");
{
#ifndef WIN32
pthread_mutex_lock(&mutex);
+ logger->log("Player", Log::DEBUG, "LOCKED");
+
#else
// FIXME Marten
#endif
void Player::unLock()
{
#ifndef WIN32
+ logger->log("Player", Log::DEBUG, "UNLOCKING");
pthread_mutex_unlock(&mutex);
#else
// FIXME Marten
void threadPostStopCleanup();
private:
- int playInt();
+ int playInt(bool* doUnlock);
void stopInt();
void togglePauseInt();
void toggleFastForwardInt();