Ticket #3794: 3794-v1.patch
File 3794-v1.patch, 3.5 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
424 424 .arg(speed,5,'f',1).arg(normal).arg(unpauseaudio)); 425 425 426 426 internalPauseLock.lock(); 427 if (editmode) 428 { 429 internalPauseLock.unlock(); 430 VERBOSE(VB_IMPORTANT, LOC + "Ignoring Play(), in edit mode."); 431 return false; 432 } 427 433 UnpauseVideo(); 428 434 internalPauseLock.unlock(); 429 435 … … 439 445 return true; 440 446 } 441 447 442 bool NuppelVideoPlayer:: GetPause(void) const448 bool NuppelVideoPlayer::IsPaused(bool *is_pause_still_possible) const 443 449 { 444 return (actuallypaused && 445 (ringBuffer == NULL || ringBuffer->isPaused()) && 446 (audioOutput == NULL || audioOutput->GetPause()) && 450 bool rbf_playing = (ringBuffer != NULL) && !ringBuffer->isPaused(); 451 bool aud_playing = (audioOutput != NULL) && !audioOutput->GetPause(); 452 if (is_pause_still_possible) 453 { 454 bool decoder_pausing = (0.0f == next_play_speed) && !next_normal_speed; 455 bool video_pausing = pausevideo; 456 bool rbuf_paused = !rbf_playing; 457 *is_pause_still_possible = 458 decoder_pausing && video_pausing && rbuf_paused; 459 } 460 461 return (actuallypaused && !rbf_playing && !aud_playing && 447 462 IsVideoActuallyPaused()); 448 463 } 449 464 … … 4443 4458 if (alreadyediting) 4444 4459 return false; 4445 4460 4446 if (GetPause()) 4447 osd->EndStatus(); 4461 // lock internal pause lock so that is_pause is definately still 4462 // valid when we enter pause wait loop. 4463 internalPauseLock.lock(); 4464 bool is_paused = IsPaused(); 4465 if (is_paused) 4466 osd->EndStatus(); // hide pause OSD 4448 4467 4449 4468 editmode = true; 4450 Pause(); 4451 while (!GetPause()) 4452 usleep(1000); 4469 bool pause_possible = false; 4470 while (!is_paused) 4471 { 4472 if (!pause_possible) 4473 { 4474 internalPauseLock.unlock(); 4475 Pause(true); 4476 internalPauseLock.lock(); 4477 } 4478 is_paused = IsPaused(&pause_possible); 4479 usleep(5000); 4480 } 4481 // safe to unlock now, play won't start with editmode enabled 4482 internalPauseLock.unlock(); 4453 4483 4454 4484 seekamount = keyframedist; 4455 4485 seekamountpos = 3; -
libs/libmythtv/NuppelVideoPlayer.h
236 236 void Pause(bool waitvideo = true); 237 237 bool Play(float speed = 1.0, bool normal = true, 238 238 bool unpauseaudio = true); 239 bool GetPause(void) const;239 bool IsPaused(bool *is_pause_still_possible = NULL) const; 240 240 241 241 // Seek stuff 242 242 bool FastForward(float seconds); -
libs/libmythtv/ivtvdecoder.cpp
99 99 videoout->Play(); 100 100 else 101 101 { 102 if (GetNVP()-> GetPause())102 if (GetNVP()->IsPaused()) 103 103 { 104 104 videoout->Pause(); 105 105 do … … 669 669 { 670 670 long long number = desiredFrame - videoPlayed; 671 671 672 if (GetNVP()-> GetPause() && number < keyframedist)672 if (GetNVP()->IsPaused() && number < keyframedist) 673 673 { 674 674 StepFrames(videoPlayed, number+1); 675 675 framesPlayed = desiredFrame + 1;