Ticket #2434: mythplayback2.diff
File mythplayback2.diff, 3.3 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
147 147 // Window stuff 148 148 parentWidget(NULL), embedid(0), embx(-1), emby(-1), embw(-1), embh(-1), 149 149 // State 150 pause_signal(false), 150 151 eof(false), m_double_framerate(false), 151 152 m_can_double(false), paused(false), 152 153 pausevideo(false), actuallypaused(false), … … 461 462 video_actually_paused = false; 462 463 pausevideo = true; 463 464 464 for (uint i = 0; wait && !video_actually_paused; i++) 465 { 466 videoThreadPaused.wait(&pauseUnpauseLock, 250); 465 VERBOSE(VB_IMPORTANT, QString("PauseVideo() Called wait=%1").arg(wait)); 467 466 468 if (video_actually_paused || eof) 467 if (wait && !video_actually_paused) { 468 uint i=0; 469 while (!pause_signal && videoThreadPause.wait(&pauseUnpauseLock, 250)) { 470 471 if (video_actually_paused || eof) { 472 pause_signal=false; 469 473 break; 474 } 470 475 471 476 if ((i % 10) == 9) 472 VERBOSE(VB_IMPORTANT, "Waited too long for video out to pause");477 VERBOSE(VB_IMPORTANT, QString("Waited too long for video out to pause %1").arg(i)); 473 478 } 474 479 } 480 pause_signal=false; 481 } 475 482 476 483 void NuppelVideoPlayer::UnpauseVideo(bool wait) 477 484 { 485 VERBOSE(VB_IMPORTANT, QString("UnpauseVideo() Called wait=%1").arg(wait)); 486 478 487 QMutexLocker locker(&pauseUnpauseLock); 479 488 pausevideo = false; 480 489 481 for (uint i = 0; wait && video_actually_paused; i++)482 {483 videoThreadUnpaused.wait(&pauseUnpauseLock, 250);490 if (wait && video_actually_paused) { 491 uint i=0; 492 while (!pause_signal && videoThreadPause.wait(&pauseUnpauseLock, 250)) { 484 493 485 if (!video_actually_paused || eof) 494 if (!video_actually_paused || eof) { 495 pause_signal=false; 486 496 break; 497 } 498 ++i; 487 499 488 500 if ((i % 10) == 9) 489 501 VERBOSE(VB_IMPORTANT, "Waited too long for video out to unpause"); 490 502 } 491 503 } 504 pause_signal=false; 505 } 492 506 493 507 void NuppelVideoPlayer::SetVideoActuallyPaused(bool val) 494 508 { 495 509 QMutexLocker locker(&pauseUnpauseLock); 496 510 video_actually_paused = val; 497 498 if (val) 499 videoThreadPaused.wakeAll(); 500 else 501 videoThreadUnpaused.wakeAll(); 511 pause_signal=true; 512 videoThreadPause.wakeAll(); 502 513 } 503 514 515 504 516 bool NuppelVideoPlayer::IsVideoActuallyPaused(void) const 505 517 { 506 518 QMutexLocker locker(&pauseUnpauseLock); -
libs/libmythtv/NuppelVideoPlayer.h
525 525 526 526 // State 527 527 QWaitCondition decoderThreadPaused; 528 QWaitCondition videoThreadPaused; 529 QWaitCondition videoThreadUnpaused; 528 QWaitCondition videoThreadPause; 530 529 mutable QMutex vidExitLock; 531 530 mutable QMutex pauseUnpauseLock; 532 531 mutable QMutex internalPauseLock; 532 bool pause_signal; 533 533 bool eof; ///< At end of file/ringbuffer 534 534 bool m_double_framerate;///< Output fps is double Video (input) rate 535 535 bool m_can_double; ///< VideoOutput capable of doubling frame rate