diff --git a/src/app/app.cpp b/src/app/app.cpp index a814165..66c37d3 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -213,6 +213,7 @@ void App::updateStats() { const double fps = statsFrameAccum_ / elapsed; const uint64_t dec = media_.decodedFrames(); const double decFps = static_cast(dec - statsLastDecoded_) / elapsed; + decFpsEma_ = (decFpsEma_ > 0.0) ? decFpsEma_ * 0.6 + decFps * 0.4 : decFps; statsFrameAccum_ = 0; statsLastDecoded_ = dec; lastStatsUpdate_ = now; @@ -272,7 +273,7 @@ void App::updateStats() { std::snprintf(buf, sizeof(buf), "Video %dx%d %s", media_.width(), media_.height(), media_.codecName().c_str()); statsLines_.emplace_back(buf); - std::snprintf(buf, sizeof(buf), "Decode %.1f / %.2f fps", decFps, + std::snprintf(buf, sizeof(buf), "Decode %.1f / %.2f fps", decFpsEma_, media_.frameRate()); statsLines_.emplace_back(buf); } diff --git a/src/app/app.hpp b/src/app/app.hpp index 479dc85..ba66d68 100644 --- a/src/app/app.hpp +++ b/src/app/app.hpp @@ -63,6 +63,7 @@ private: std::chrono::steady_clock::time_point lastStatsUpdate_{}; int statsFrameAccum_ = 0; uint64_t statsLastDecoded_ = 0; + double decFpsEma_ = 0.0; // smoothed decode fps (the raw window is bursty) unsigned long long cpuPrevIdle_ = 0; unsigned long long cpuPrevTotal_ = 0; std::vector statsLines_; diff --git a/src/media/media_engine.cpp b/src/media/media_engine.cpp index 5f118ef..2b8191c 100644 --- a/src/media/media_engine.cpp +++ b/src/media/media_engine.cpp @@ -60,7 +60,7 @@ void smb_auth(SMBCCTX*, const char*, const char*, char*, int, char* un, int unle // Only the prefetch thread touches the SMB handle (read/lseek); the AVIO // callbacks only touch the ring and request seeks. struct SmbReadAhead { - static constexpr std::size_t kCapacity = 32u << 20; // 32 MiB cushion + static constexpr std::size_t kCapacity = 64u << 20; // 64 MiB cushion static constexpr std::size_t kChunk = 256u << 10; // 256 KiB network reads SMBCCTX* ctx = nullptr;