]> git.vomp.tv Git - vompclient.git/commitdiff
Bug fixes
authorChris Tallon <chris@vomp.tv>
Sat, 13 May 2006 12:59:19 +0000 (12:59 +0000)
committerChris Tallon <chris@vomp.tv>
Sat, 13 May 2006 12:59:19 +0000 (12:59 +0000)
demuxervdr.cc
log.cc
player.cc
player.h

index a2784567d79e72468beb4810f6ace5ae26117d8b..2c3fd0389e476eb0ac21199cb8066af1c14daadf 100644 (file)
@@ -56,7 +56,7 @@ int DemuxerVDR::scan(UCHAR *buf, int len)
   }
   return ret;
 }
-    
+
 int DemuxerVDR::findVideoPTS(UCHAR* buf, int len, ULLONG* dest)
 {
   while (len >= 14)
@@ -129,7 +129,7 @@ int DemuxerVDR::put(UCHAR* buf, int len)
     }
   }
 
-  while (len >= 0)
+  while (len > 0)
   {
     switch (state)
     {
diff --git a/log.cc b/log.cc
index 5aa1f4c98a8c1b3bfd280f71cb360318d062e5c8..884769fc6f4683b20ee38a36abdb1f428d6f07ea 100644 (file)
--- a/log.cc
+++ b/log.cc
@@ -74,6 +74,8 @@ int Log::init(int startLogLevel, char* fileName, int tenabled)
 //  logfile = fopen(fileName, "a");
 //  logfile = fopen(stdout, "a");
   logfile = stdout;
+//  logfile = fopen("/log", "a");
+
   if (logfile) return 1;
   else return 0;
 }
index 621a87897f6b2d7182f4433fb5b42b58dc8b4852..a07d8ce7d29f3ef890fe7f8f91cc778152bdceb7 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -157,8 +157,10 @@ ULLONG Player::getPositionTS() // used internall (skip fw/bw)
 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()
@@ -213,7 +215,7 @@ void Player::skipBackward(int seconds)
 // ----------------------------------- Implementations called events
 
 
-int Player::playInt()
+int Player::playInt(bool* doUnlock)
 {
   if (!initted) return 0;
 
@@ -221,6 +223,7 @@ int Player::playInt()
   if (paused)
   {
     togglePauseInt();
+    *doUnlock = true;
     return 1;
   }
 
@@ -238,6 +241,13 @@ int Player::playInt()
     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");
 
@@ -429,6 +439,8 @@ void Player::lock()
 {
 #ifndef WIN32
   pthread_mutex_lock(&mutex);
+  logger->log("Player", Log::DEBUG, "LOCKED");
+
 #else
   // FIXME Marten
 #endif
@@ -437,6 +449,7 @@ void Player::lock()
 void Player::unLock()
 {
 #ifndef WIN32
+  logger->log("Player", Log::DEBUG, "UNLOCKING");
   pthread_mutex_unlock(&mutex);
 #else
   // FIXME Marten
index 228f6d271f88038566278736f60e688bc4d1d435..1496dce74f63203661b42ade0f45df9794359b89 100644 (file)
--- a/player.h
+++ b/player.h
@@ -78,7 +78,7 @@ class Player : public Thread_TYPE, public Callback
     void threadPostStopCleanup();
 
   private:
-    int playInt();
+    int playInt(bool* doUnlock);
     void stopInt();
     void togglePauseInt();
     void toggleFastForwardInt();