Skip to content

Commit

Permalink
kodi: Revert "VideoPlayer: use data level to determine filling level …
Browse files Browse the repository at this point in the history
…of buffer level" patch from CE
  • Loading branch information
AlexELEC committed May 12, 2024
1 parent c360e3b commit a934f39
Showing 1 changed file with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
diff -Naurp kodi/xbmc/cores/VideoPlayer/DVDMessageQueue.cpp kodi-patch/xbmc/cores/VideoPlayer/DVDMessageQueue.cpp
--- kodi/xbmc/cores/VideoPlayer/DVDMessageQueue.cpp 2024-05-12 07:45:35.665356582 +0000
+++ kodi-patch/xbmc/cores/VideoPlayer/DVDMessageQueue.cpp 2024-05-12 07:47:03.057082436 +0000
@@ -307,7 +307,7 @@ void CDVDMessageQueue::WaitUntilEmpty()
}
}

-int CDVDMessageQueue::GetLevel(bool data_level) const
+int CDVDMessageQueue::GetLevel() const
{
std::unique_lock<CCriticalSection> lock(m_section);

@@ -316,9 +316,9 @@ int CDVDMessageQueue::GetLevel(bool data
if (m_iDataSize == 0)
return 0;

- if (IsDataBased() || data_level)
+ if (IsDataBased())
{
- return std::min((uint64_t)100, 100 * m_iDataSize / m_iMaxDataSize);
+ return std::min(100, 100 * m_iDataSize / m_iMaxDataSize);
}

int level = std::min(100.0, ceil(100.0 * m_TimeSize * (m_TimeFront - m_TimeBack) / DVD_TIME_BASE ));
diff -Naurp kodi/xbmc/cores/VideoPlayer/DVDMessageQueue.h kodi-patch/xbmc/cores/VideoPlayer/DVDMessageQueue.h
--- kodi/xbmc/cores/VideoPlayer/DVDMessageQueue.h 2024-05-12 07:45:35.665356582 +0000
+++ kodi-patch/xbmc/cores/VideoPlayer/DVDMessageQueue.h 2024-05-12 07:47:03.057082436 +0000
@@ -80,8 +80,8 @@ public:
void WaitUntilEmpty();

// non messagequeue related functions
- bool IsFull() const { return GetLevel(true) == 100; }
- int GetLevel(bool data_level = false) const;
+ bool IsFull() const { return GetLevel() == 100; }
+ int GetLevel() const;

void SetMaxDataSize(int iMaxDataSize) { m_iMaxDataSize = iMaxDataSize; }
void SetMaxTimeSize(double sec) { m_TimeSize = 1.0 / std::max(1.0, sec); }
@@ -102,14 +102,15 @@ private:
bool m_bInitialized;
bool m_drain = false;

- uint64_t m_iDataSize;
+ int m_iDataSize;
double m_TimeFront;
double m_TimeBack;
double m_TimeSize;

- uint64_t m_iMaxDataSize;
+ int m_iMaxDataSize;
std::string m_owner;

std::list<DVDMessageListItem> m_messages;
std::list<DVDMessageListItem> m_prioMessages;
};
+
diff -Naurp kodi/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp kodi-patch/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
--- kodi/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp 2024-05-12 07:45:35.669356569 +0000
+++ kodi-patch/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp 2024-05-12 07:47:03.057082436 +0000
@@ -62,7 +62,7 @@ CVideoPlayerAudio::CVideoPlayerAudio(CDV
m_maxspeedadjust = 0.0;

// 18 MB allows max bitrate of 18 Mbit/s (TrueHD max peak) during 8 seconds
- m_messageQueue.SetMaxDataSize(32 * 1024 * 1024);
+ m_messageQueue.SetMaxDataSize(18 * 1024 * 1024);
m_messageQueue.SetMaxTimeSize(8.0);
m_disconAdjustTimeMs = processInfo.GetMaxPassthroughOffSyncDuration();
}
@@ -202,7 +202,7 @@ void CVideoPlayerAudio::OnStartup()
void CVideoPlayerAudio::UpdatePlayerInfo()
{
std::ostringstream s;
- s << "aq:" << std::setw(2) << std::min(99,m_messageQueue.GetLevel()) << "% (" << std::setw(2) << std::min(99,m_messageQueue.GetLevel(true)) << "%)";
+ s << "aq:" << std::setw(2) << std::min(99,m_messageQueue.GetLevel()) << "%";
s << ", Kb/s:" << std::fixed << std::setprecision(2) << m_audioStats.GetBitrate() / 1024.0;
s << ", ac:" << m_processInfo.GetAudioDecoderName().c_str();
if (!m_info.passthrough)
diff -Naurp kodi/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp kodi-patch/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
--- kodi/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp 2024-05-12 07:45:35.669356569 +0000
+++ kodi-patch/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp 2024-05-12 07:47:03.057082436 +0000
@@ -71,7 +71,7 @@ CVideoPlayerVideo::CVideoPlayerVideo(CDV
m_fForcedAspectRatio = 0;

// 128 MB allows max bitrate of 128 Mbit/s (e.g. UHD Blu-Ray) during 8 seconds
- m_messageQueue.SetMaxDataSize(40 * 1024 * 1024);
+ m_messageQueue.SetMaxDataSize(128 * 1024 * 1024);
m_messageQueue.SetMaxTimeSize(8.0);

m_iDroppedFrames = 0;
@@ -1024,7 +1024,7 @@ std::string CVideoPlayerVideo::GetPlayer
int width, height;
m_processInfo.GetVideoDimensions(width, height);
std::ostringstream s;
- s << "vq:" << std::setw(2) << std::min(99, m_messageQueue.GetLevel()) << "% (" << std::setw(2) << std::min(99, m_messageQueue.GetLevel(true)) << "%)";
+ s << "vq:" << std::setw(2) << std::min(99, m_processInfo.GetLevelVQ()) << "%";
s << ", Mb/s:" << std::fixed << std::setprecision(2) << (double)GetVideoBitrate() / (1024.0*1024.0);
s << ", dc:" << m_processInfo.GetVideoDecoderName().c_str();
s << ", " << width << "x" << height << (m_processInfo.GetVideoInterlaced() ? "i" : "p") << " [" << std::setprecision(2) << m_processInfo.GetVideoDAR() << "]@" << std::fixed << std::setprecision(3) << m_processInfo.GetVideoFps() << ", deint:" << m_processInfo.GetVideoDeintMethod();

0 comments on commit a934f39

Please sign in to comment.