Fix VideoPlayer from stop after just few frames

This commit is contained in:
2026-05-07 18:17:33 +10:00
parent a526aa6cdb
commit 2e0fee5e3d
6 changed files with 55 additions and 32 deletions
+6 -7
View File
@@ -22,12 +22,12 @@ namespace ANSCENTER
{
protected:
cv::VideoCapture cap;
int _resWidth;
int _resHeight;
int64_t _totalFrames;
int64_t _currentFrame;
int64_t _previousPTS;
double _fps;
int _resWidth = 0;
int _resHeight = 0;
int64_t _totalFrames = 0;
int64_t _currentFrame = 0;
int64_t _previousPTS = 0;
double _fps = 0.0;
bool _isPlaying;
std::string _lastJpegImage;
cv::Mat _previousImage;
@@ -50,7 +50,6 @@ namespace ANSCENTER
bool _hwCudaAccel = false; // true = NVIDIA CUDA zero-copy available
bool _hwEOF = false; // true when video reached end of file
int64_t _hwFrameCount = 0; // frame counter for EOF detection
int64_t _hwLastElapseMs = 0; // last CFilePlayer elapse (ms); EOF detected when it wraps backwards
ANSVIDEOPLAYER();
~ANSVIDEOPLAYER() noexcept;
[[nodiscard]] bool Init(std::string licenseKey, std::string url);