[haiku-commits] r38667 - haiku/trunk/src/apps/mediaplayer/media_node_framework

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 16 Sep 2010 14:37:45 +0200 (CEST)

Author: stippi
Date: 2010-09-16 14:37:45 +0200 (Thu, 16 Sep 2010)
New Revision: 38667
Changeset: http://dev.haiku-os.org/changeset/38667

Modified:
   haiku/trunk/src/apps/mediaplayer/media_node_framework/NodeManager.cpp
Log:
Enabled the code which sets the consumer run-mode based
on the current play back mode. I.e. paused or stopped
playback get's B_OFFLINE run-mode, which makes sure the
Consumer does not drop frames when they are too late.
When single stepping frames backwards, the producer may
have needed a lot of time to generate a frame and it may
arrive late, which is no problem when the video is paused.


Modified: haiku/trunk/src/apps/mediaplayer/media_node_framework/NodeManager.cpp
===================================================================
--- haiku/trunk/src/apps/mediaplayer/media_node_framework/NodeManager.cpp       
2010-09-16 12:36:11 UTC (rev 38666)
+++ haiku/trunk/src/apps/mediaplayer/media_node_framework/NodeManager.cpp       
2010-09-16 12:37:45 UTC (rev 38667)
@@ -111,12 +111,17 @@
 void
 NodeManager::SetPlayMode(int32 mode, bool continuePlaying)
 {
-//     if (fMediaRoster && fMediaRoster->Lock()) {
-//             BMediaNode::run_mode runMode = mode > 0 ?
-//                     BMediaNode::B_DROP_DATA : BMediaNode::B_OFFLINE;
-//             fMediaRoster->SetRunModeNode(fVideoConnection.consumer, 
runMode);
-//             fMediaRoster->Unlock();
-//     }
+       if (fMediaRoster != NULL && fMediaRoster->Lock()) {
+               BMediaNode::run_mode runMode = mode > 0 ?
+                       BMediaNode::B_DROP_DATA : BMediaNode::B_OFFLINE;
+               status_t ret = 
fMediaRoster->SetRunModeNode(fVideoConnection.consumer,
+                       runMode);
+               if (ret != B_OK) {
+                       printf("NodeManager::SetPlayMode(%ld), setting run mode 
failed: "
+                               "%s\n", mode, strerror(ret));
+               }
+               fMediaRoster->Unlock();
+       }
 
        PlaybackManager::SetPlayMode(mode, continuePlaying);
 }
@@ -690,8 +695,6 @@
 
        bigtime_t perf = timeSource->PerformanceTimeFor(real + latency
                + initLatency);
-printf("performance time for %lld: %lld\n", real + latency
-       + initLatency, perf);
 
        timeSource->Release();
 


Other related posts:

  • » [haiku-commits] r38667 - haiku/trunk/src/apps/mediaplayer/media_node_framework - superstippi