Fix Video Player that support generate black image when finish playing video (reach the end of video)

This commit is contained in:
2026-04-23 08:08:34 +10:00
parent f068eb716f
commit c625898f61
4 changed files with 24 additions and 17 deletions

View File

@@ -17,6 +17,7 @@
namespace ANSCENTER
{
// This class only allow to run 1 (to the end of video) then it will generate blank dark image
class ANSVIDEOPLAYER_API ANSVIDEOPLAYER
{
protected:
@@ -49,7 +50,7 @@ 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 _hwLastPts = 0; // last video PTS for EOF wrap 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);