Ticket #2287: multi-pip-dbg-only-v9.patch
File multi-pip-dbg-only-v9.patch, 10.6 KB (added by , 15 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
873 873 * \param novideo if true then no video is sought in ScanSreams. 874 874 * \param testbuf this parameter is not used by AvFormatDecoder. 875 875 */ 876 extern "C" { 877 #include "libavutil/crc.h" 878 } 876 879 int AvFormatDecoder::OpenFile(RingBuffer *rbuffer, bool novideo, 877 880 char testbuf[kDecoderProbeBufferSize], 878 881 int testbufsize) … … 899 902 probe.buf_size = kDecoderProbeBufferSize - AVPROBE_PADDING_SIZE; 900 903 901 904 fmt = av_probe_input_format(&probe, true); 905 uint checksum = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 906 (uint32_t) -1, 907 (uint8_t*)testbuf, probe.buf_size - 1); 902 908 if (!fmt) 903 909 { 904 910 VERBOSE(VB_IMPORTANT, LOC_ERR + 905 QString("Probe failed for file: \"%1\".").arg(filename)); 911 QString("Probe failed for file: '%1' probe size %2 crc 0x%3") 912 .arg(filename).arg(probe.buf_size).arg(checksum,0,16)); 906 913 return -1; 907 914 } 915 VERBOSE(VB_IMPORTANT, LOC + 916 QString("Probe suceeded for file: '%1' probe size %2 crc 0x%3") 917 .arg(filename).arg(probe.buf_size).arg(checksum,0,16)); 908 918 909 919 fmt->flags |= AVFMT_NOFILE; 910 920 -
libs/libmythtv/tv_play.h
291 291 292 292 int StartTimer(int interval, int line); 293 293 void KillTimer(int id); 294 void ForceNextStateNone(PlayerContext* );294 void ForceNextStateNone(PlayerContext*, int line); 295 295 void ScheduleStateChange(PlayerContext*); 296 296 void SetErrored(PlayerContext*); 297 void SetExitPlayer (bool set_it, bool wants_to) const;297 void SetExitPlayerReal(bool set_it, bool wants_to, int line) const; 298 298 void SetUpdateOSDPosition(bool set_it); 299 299 300 300 bool PxPHandleAction(PlayerContext*,const QStringList &actions); -
libs/libmythtv/playercontext.cpp
102 102 newPlaygroup = playingInfo->playgroup; 103 103 } 104 104 105 ChangeState(newState );105 ChangeState(newState, __LINE__); 106 106 SetPlayGroup(newPlaygroup); 107 107 } 108 108 … … 589 589 /** 590 590 * \brief Puts a state change on the nextState queue. 591 591 */ 592 void PlayerContext::ChangeState(TVState newState )592 void PlayerContext::ChangeState(TVState newState, int line) 593 593 { 594 VERBOSE(VB_IMPORTANT, QString("ChangeState(%1,%2)") 595 .arg(StateToString(newState)).arg(line)); 594 596 QMutexLocker locker(&stateLock); 595 597 nextState.enqueue(newState); 596 598 } … … 604 606 /** 605 607 * \brief Removes any pending state changes, and puts kState_None on the queue. 606 608 */ 607 void PlayerContext::ForceNextStateNone( void)609 void PlayerContext::ForceNextStateNone(int line) 608 610 { 611 VERBOSE(VB_IMPORTANT, QString("ForceNextStateNone(%2)").arg(line)); 609 612 QMutexLocker locker(&stateLock); 610 613 nextState.clear(); 611 614 nextState.push_back(kState_None); -
libs/libmythtv/tv_play.cpp
65 65 66 66 #define GetPlayer(X,Y) GetPlayerHaveLock(X, Y, __FILE__ , __LINE__) 67 67 #define GetOSDLock(X) GetOSDL(X, __FILE__, __LINE__) 68 #define SetExitPlayer(X,Y) SetExitPlayerReal(X,Y,__LINE__) 68 69 69 70 const int TV::kInitFFRWSpeed = 0; 70 71 const uint TV::kInputKeysMax = 6; … … 178 179 VERBOSE(VB_PLAYBACK, LOC + "tv->LiveTV() -- begin"); 179 180 if (!tv->LiveTV(showDialogs, startInGuide)) 180 181 { 181 tv->SetExitPlayer (true, true);182 tv->SetExitPlayerReal(true, true, __LINE__); 182 183 quitAll = true; 183 184 } 184 185 VERBOSE(VB_PLAYBACK, LOC + "tv->LiveTV() -- end"); … … 2066 2067 mctx = GetPlayerWriteLock(0, __FILE__, __LINE__); 2067 2068 if (!mctx->IsErrored() && (GetState(mctx) != kState_None)) 2068 2069 { 2069 mctx->ForceNextStateNone( );2070 mctx->ForceNextStateNone(__LINE__); 2070 2071 HandleStateChange(mctx, mctx); 2071 2072 if (jumpToProgram) 2072 2073 TeardownPlayer(mctx, mctx); … … 2380 2381 jumpToProgram = false; 2381 2382 } 2382 2383 else 2383 ForceNextStateNone(mctx );2384 ForceNextStateNone(mctx, __LINE__); 2384 2385 } 2385 2386 else 2386 ForceNextStateNone(mctx );2387 ForceNextStateNone(mctx, __LINE__); 2387 2388 2388 2389 ReturnPlayerLock(mctx); 2389 2390 … … 2582 2583 (mctx->nvp && mctx->nvp->IsErrored()) || mctx->IsErrored()) 2583 2584 { 2584 2585 SetExitPlayer(true, false); 2585 ForceNextStateNone(mctx );2586 ForceNextStateNone(mctx, __LINE__); 2586 2587 error = true; 2587 2588 } 2588 2589 … … 2590 2591 { 2591 2592 PlayerContext *ctx = GetPlayer(mctx, i); 2592 2593 if (error || ctx->IsErrored()) 2593 ForceNextStateNone(ctx );2594 ForceNextStateNone(ctx, __LINE__); 2594 2595 } 2595 2596 ReturnPlayerLock(mctx); 2596 2597 … … 2703 2704 QObject::killTimer(id); 2704 2705 } 2705 2706 2706 void TV::ForceNextStateNone(PlayerContext *ctx )2707 void TV::ForceNextStateNone(PlayerContext *ctx, int line) 2707 2708 { 2708 ctx->ForceNextStateNone( );2709 ctx->ForceNextStateNone(line); 2709 2710 ScheduleStateChange(ctx); 2710 2711 } 2711 2712 … … 2723 2724 errorRecoveryTimerId = StartTimer(1, __LINE__); 2724 2725 } 2725 2726 2726 void TV::SetExitPlayer (bool set_it, bool wants_to) const2727 void TV::SetExitPlayerReal(bool set_it, bool wants_to, int line) const 2727 2728 { 2729 VERBOSE(VB_IMPORTANT, 2730 LOC + "SetExitPlayer("<<set_it<<","<<wants_to<<","<<line<<")"); 2731 2728 2732 QMutexLocker locker(&timerIdLock); 2729 2733 if (set_it) 2730 2734 { … … 2780 2784 continue; 2781 2785 } 2782 2786 2783 ForceNextStateNone(ctx );2787 ForceNextStateNone(ctx, __LINE__); 2784 2788 if (mctx == ctx) 2785 2789 { 2786 2790 endOfRecording = true; … … 3926 3930 } 3927 3931 else if (has_action("ESCAPE", actions)) 3928 3932 { 3933 VERBOSE(VB_IMPORTANT, LOC + "ESCAPE"); 3934 3929 3935 osd = GetOSDLock(ctx); 3930 3936 if (StateIsLiveTV(ctx->GetState()) && 3931 3937 (ctx->lastSignalMsgTime.elapsed() < … … 4598 4604 swap(player[0],player[1]); 4599 4605 player[0]->SetPIPState(kPIPOff); 4600 4606 // End the old main context.. 4601 ForceNextStateNone(mctx );4607 ForceNextStateNone(mctx, __LINE__); 4602 4608 } 4603 4609 4604 4610 VERBOSE(VB_PLAYBACK, LOC + "CreatePBP() -- end : "<<ok); … … 4698 4704 return true; 4699 4705 } 4700 4706 4701 ForceNextStateNone(ctx );4707 ForceNextStateNone(ctx, __LINE__); 4702 4708 VERBOSE(VB_IMPORTANT, "StartPlayer PiP -- end : !ok"); 4703 4709 return false; 4704 4710 } … … 4855 4861 msg = (ctx1->isPIP()) ? tr("Stopping PIP") : tr("Stopping PBP"); 4856 4862 if (dctx) 4857 4863 { 4858 ForceNextStateNone(dctx );4864 ForceNextStateNone(dctx, __LINE__); 4859 4865 } 4860 4866 else 4861 4867 { … … 4866 4872 } 4867 4873 4868 4874 for (uint i = player.size() - 1; i > 0; i--) 4869 ForceNextStateNone(GetPlayer(actx,i) );4875 ForceNextStateNone(GetPlayer(actx,i), __LINE__); 4870 4876 } 4871 4877 4872 4878 OSD *osd = GetOSDLock(mctx); … … 5063 5069 return; 5064 5070 } 5065 5071 5066 ForceNextStateNone(mctx );5072 ForceNextStateNone(mctx, __LINE__); 5067 5073 VERBOSE(VB_PLAYBACK, LOC + 5068 5074 "PBPRestartMainNVP -- end !ok NVP did not restart"); 5069 5075 } … … 5097 5103 { 5098 5104 VERBOSE(VB_IMPORTANT, loc + 5099 5105 "Failed to restart new main context (was pip context)"); 5100 ForceNextStateNone(mctx );5106 ForceNextStateNone(mctx, __LINE__); 5101 5107 return; 5102 5108 } 5103 5109 … … 5122 5128 { // TODO print OSD informing user of Swap failure ? 5123 5129 VERBOSE(VB_IMPORTANT, loc + 5124 5130 "Failed to restart new pip context (was main context)"); 5125 ForceNextStateNone(pipctx );5131 ForceNextStateNone(pipctx, __LINE__); 5126 5132 } 5127 5133 } 5128 5134 … … 7628 7634 { 7629 7635 ctx->nvp->SetWatchingRecording(false); 7630 7636 ctx->nvp->SetLength(filelen); 7631 ctx->ChangeState(kState_WatchingPreRecorded );7637 ctx->ChangeState(kState_WatchingPreRecorded, __LINE__); 7632 7638 ScheduleStateChange(ctx); 7633 7639 } 7634 7640 } … … 10496 10502 { 10497 10503 playerLock.lockForWrite(); 10498 10504 10505 //VERBOSE(VB_IMPORTANT, LOC_WARN + 10506 // QString("GetPlayerWriteLock(%1,%2,%3) size(%4)") 10507 // .arg(which).arg(file).arg(location).arg(player.size())); 10508 10499 10509 if ((which >= (int)player.size())) 10500 10510 { 10501 10511 VERBOSE(VB_IMPORTANT, LOC_WARN + … … 10511 10521 { 10512 10522 playerLock.lockForRead(); 10513 10523 10524 //VERBOSE(VB_IMPORTANT, LOC_WARN + 10525 // QString("GetPlayerReadLock(%1,%2,%3) size(%4)") 10526 // .arg(which).arg(file).arg(location).arg(player.size())); 10527 10514 10528 if ((which >= (int)player.size())) 10515 10529 { 10516 10530 VERBOSE(VB_IMPORTANT, LOC_WARN + … … 10527 10541 { 10528 10542 playerLock.lockForRead(); 10529 10543 10544 //VERBOSE(VB_IMPORTANT, LOC_WARN + 10545 // QString("GetPlayerReadLock(%1,%2,%3) const size(%4)") 10546 // .arg(which).arg(file).arg(location).arg(player.size())); 10547 10530 10548 if ((which >= (int)player.size())) 10531 10549 { 10532 10550 VERBOSE(VB_IMPORTANT, LOC_WARN + … … 10574 10592 10575 10593 void TV::ReturnPlayerLock(PlayerContext *&ctx) 10576 10594 { 10595 //VERBOSE(VB_IMPORTANT, LOC_WARN + 10596 // QString("ReturnPlayerLock() size(%4)") 10597 // .arg(player.size())); 10598 10577 10599 playerLock.unlock(); 10578 10600 ctx = NULL; 10579 10601 } 10580 10602 10581 10603 void TV::ReturnPlayerLock(const PlayerContext *&ctx) const 10582 10604 { 10605 //VERBOSE(VB_IMPORTANT, LOC_WARN + 10606 // QString("ReturnPlayerLock() const size(%4)") 10607 // .arg(player.size())); 10608 10583 10609 playerLock.unlock(); 10584 10610 ctx = NULL; 10585 10611 } -
libs/libmythtv/playercontext.h
88 88 void LockState(void) const; 89 89 void UnlockState(void) const; 90 90 bool InStateChange(void) const; 91 void ChangeState(TVState newState );92 void ForceNextStateNone( void);91 void ChangeState(TVState newState, int line); 92 void ForceNextStateNone(int line); 93 93 TVState DequeueNextState(void); 94 94 TVState GetState(void) const; 95 95 /// This is set if the player encountered some irrecoverable error.