Advertisement
Guest User

Untitled

a guest
Feb 9th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
  2. index a57a026187..13dd213d0b 100644
  3. --- a/mythtv/libs/libmythtv/mythplayer.cpp
  4. +++ b/mythtv/libs/libmythtv/mythplayer.cpp
  5. @@ -270,7 +270,7 @@ bool MythPlayer::Pause(void)
  6. if (FlagIsSet(kVideoIsNull) && m_decoder)
  7. m_decoder->UpdateFramesPlayed();
  8. else if (m_videoOutput && !FlagIsSet(kVideoIsNull))
  9. - m_framesPlayed = m_videoOutput->GetFramesPlayed() + m_framesPlayedExtra;
  10. + m_framesPlayed = m_videoOutput->GetFramesPlayed();
  11. }
  12. m_pauseLock.unlock();
  13. return already_paused;
  14. @@ -860,7 +860,6 @@ int MythPlayer::OpenFile(int Retries)
  15. void MythPlayer::SetFramesPlayed(uint64_t played)
  16. {
  17. m_framesPlayed = played;
  18. - m_framesPlayedExtra = 0;
  19. if (m_videoOutput)
  20. m_videoOutput->SetFramesPlayed(played);
  21. }
  22. @@ -1626,8 +1625,11 @@ void MythPlayer::AVSync(VideoFrame *buffer)
  23. framedue = unow + m_frameInterval / 2;
  24.  
  25. // recalculate m_framesPlayed to conform to actual time code.
  26. - m_framesPlayed = TranslatePositionMsToFrame(static_cast<uint64_t>(videotimecode + m_timeOffsetBase), false);
  27. - m_decoder->SetFramesPlayed(static_cast<long long>(m_framesPlayed));
  28. + uint64_t framesplayed = TranslatePositionMsToFrame(static_cast<uint64_t>(videotimecode + m_timeOffsetBase), false);
  29. + uint64_t framesdecoded = m_decoder->GetFramesPlayed();
  30. + uint64_t framesread = m_decoder->GetFramesRead();
  31. + LOG(VB_GENERAL, LOG_INFO, LOC + QString("Read: %1 Decoded: %2 Played: %3 Actual played: %4")
  32. + .arg(framesread).arg(framesdecoded).arg(framesplayed).arg(m_framesPlayed));
  33.  
  34. lateness = unow - framedue;
  35. dropframe = false;
  36. @@ -1722,6 +1724,7 @@ void MythPlayer::AVSync(VideoFrame *buffer)
  37. LOG(VB_PLAYBACK, LOG_INFO, LOC +
  38. QString("dropping frame to catch up, lateness=%1 usec")
  39. .arg(lateness));
  40. + m_videoOutput->SetFramesPlayed(++m_framesPlayed);
  41. }
  42. else if (!FlagIsSet(kVideoIsNull) && buffer)
  43. {
  44. @@ -1872,11 +1875,6 @@ bool MythPlayer::PrebufferEnoughFrames(int min_buffers)
  45. {
  46. uint64_t frameCount = GetCurrentFrameCount();
  47. uint64_t framesLeft = frameCount - m_framesPlayed;
  48. - // Sometimes m_framesPlayed > frameCount. Until that can
  49. - // be fixed, set framesLeft = 0 so the forced pause below
  50. - // is performed.
  51. - if (m_framesPlayed > frameCount)
  52. - framesLeft = 0;
  53. auto margin = (uint64_t) (m_videoFrameRate * 3);
  54. if (framesLeft < margin)
  55. {
  56. @@ -2194,7 +2192,7 @@ bool MythPlayer::VideoLoop(void)
  57. else if (m_decoder && m_decoder->GetEof() != kEofStateNone)
  58. ++m_framesPlayed;
  59. else
  60. - m_framesPlayed = m_videoOutput->GetFramesPlayed() + m_framesPlayedExtra;
  61. + m_framesPlayed = m_videoOutput->GetFramesPlayed();
  62. return !IsErrored();
  63. }
  64.  
  65. @@ -2289,7 +2287,7 @@ void MythPlayer::ResetPlaying(bool resetframes)
  66. ClearAfterSeek();
  67. m_ffrewSkip = 1;
  68. if (resetframes)
  69. - m_framesPlayed = m_framesPlayedExtra = 0;
  70. + m_framesPlayed = 0;
  71. if (m_decoder)
  72. {
  73. m_decoder->Reset(true, true, true);
  74. @@ -2602,7 +2600,6 @@ bool MythPlayer::StartPlaying(void)
  75. }
  76.  
  77. m_framesPlayed = 0;
  78. - m_framesPlayedExtra = 0;
  79. m_rewindTime = m_ffTime = 0;
  80. m_nextPlaySpeed = m_audio.GetStretchFactor();
  81. m_jumpChapter = 0;
  82. @@ -4594,7 +4591,6 @@ void MythPlayer::InitForTranscode(bool copyaudio, bool copyvideo)
  83. }
  84.  
  85. m_framesPlayed = 0;
  86. - m_framesPlayedExtra = 0;
  87. ClearAfterSeek();
  88.  
  89. if (copyvideo && m_decoder)
  90. diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
  91. index 54a581370a..39fc7f58d8 100644
  92. --- a/mythtv/libs/libmythtv/mythplayer.h
  93. +++ b/mythtv/libs/libmythtv/mythplayer.h
  94. @@ -730,9 +730,6 @@ class MTV_PUBLIC MythPlayer
  95. /// How often we have tried to wait for a video output buffer and failed
  96. int m_videobufRetries {0};
  97. uint64_t m_framesPlayed {0};
  98. - // "Fake" frame counter for when the container frame rate doesn't
  99. - // match the stream frame rate.
  100. - uint64_t m_framesPlayedExtra {0};
  101. uint64_t m_totalFrames {0};
  102. long long m_totalLength {0};
  103. int64_t m_totalDuration {0};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement