]> git.vomp.tv Git - vompclient.git/commitdiff
Prev channel and prebuffering osd fixes
authorChris Tallon <chris@vomp.tv>
Sat, 3 May 2008 14:24:59 +0000 (14:24 +0000)
committerChris Tallon <chris@vomp.tv>
Sat, 3 May 2008 14:24:59 +0000 (14:24 +0000)
playerlivetv.h
vvideolivetv.cc
vvideolivetv.h

index 0d2c5c691b3bab203cf56c9560b21d6bd03f5739..c06a55b8fdce1def2b7f6152975a98bf6b6230db 100644 (file)
@@ -117,7 +117,7 @@ class PlayerLiveTV : public PlayerLive, public Thread_TYPE, public Callback, pub
     bool videoStartup;
     bool stopNow;
     int preBufferCount;
-    const static int preBufferAmount = 10;
+    const static int preBufferAmount = 3;
 
     void clearStreamChunks();
     void chunkToDemuxer();
index b3c5f27e97f5270cec5a474f20aa741f7c840975..97a47fe178d148bc2ed5b40270ac47cea6ed0497 100644 (file)
@@ -55,6 +55,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V
   previousChannelIndex = 0;
   osdChannelIndex = 0;
   keying = 0;
+  preBuffering = 0;
 
   playing = false;
 
@@ -309,6 +310,8 @@ int VVideoLiveTV::handleCommand(int command)
     case Remote::PREVCHANNEL:
     {
       channelChange(PREVIOUS, 0);
+      osdChannelIndex = currentChannelIndex;
+      displayOSD(true);
       return 2;
     }
     case Remote::OK:
@@ -713,6 +716,14 @@ void VVideoLiveTV::timercall(int ref)
     }
     else
     {
+      // We have received a timer, we are not keying. If still prebuffering, don't remove the bar
+      if (preBuffering < 100)
+      {
+        Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Still prebuffering, not removing osd...");  
+        Timers::getInstance()->setTimerD(this, 1, 2); // reset timer for another 2s
+        return;
+      }
+      
       osd.setVisible(false);
       draw();
       Message* m = new Message();
@@ -784,6 +795,8 @@ bool VVideoLiveTV::channelChange(UCHAR changeType, UINT newData)
   previousChannelIndex = currentChannelIndex;
   currentChannelIndex = newChannel;
   
+  preBuffering = 0;
+  
   Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Set player to channel %u", currentChannelIndex);
   player->setChannel(currentChannelIndex);
   Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Done Set player to channel %u", currentChannelIndex);
@@ -918,13 +931,14 @@ void VVideoLiveTV::processMessage(Message* m)
       }
       case PlayerLiveTV::PREBUFFERING:
       {
-        Log::getInstance()->log("VVideoRec", Log::DEBUG, "Prebuffering - %u", m->tag);
-        bufferBar.setVisible(true);
-        bufferBar.setPercent(m->tag);
-        bufferBar.draw();
+        preBuffering = m->tag;
+        Log::getInstance()->log("VVideoRec", Log::DEBUG, "Prebuffering - %u", preBuffering);
+        bufferBar.setPercent(preBuffering);
 
         if (osd.getVisible())
         {
+          bufferBar.setVisible(true);
+          bufferBar.draw();
           Region r;
           bufferBar.getRootBoxRegion(&r);
           BoxStack::getInstance()->update(this, &r);
index cb04e4117cf94dcb66d255a60d42c4ecc19e02e7..c009154c3f2b5d9ddc575209de8073853d82dc2a 100644 (file)
@@ -79,6 +79,7 @@ class VVideoLiveTV : public Boxx, public TimerReceiver
     int numberWidth;
     int videoMode;
     ULONG streamType;
+    ULONG preBuffering;
 
     UINT currentChannelIndex;
     UINT previousChannelIndex;