mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Make VideoStream::isPlaying return false when EOS has been reached
Before it would return the playing status of the FrameSync, but a DeltaSync doesn't stop at the end of the video, now it returns the least of the FrameSync and the EOS condition
This commit is contained in:
@@ -52,12 +52,12 @@ void VideoStream::seek(double offset)
|
|||||||
frameSync->seek(offset);
|
frameSync->seek(offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
double VideoStream::tell()
|
double VideoStream::tell() const
|
||||||
{
|
{
|
||||||
return frameSync->tell();
|
return frameSync->tell();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoStream::isPlaying()
|
bool VideoStream::isPlaying() const
|
||||||
{
|
{
|
||||||
return frameSync->isPlaying();
|
return frameSync->isPlaying();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ public:
|
|||||||
virtual void play();
|
virtual void play();
|
||||||
virtual void pause();
|
virtual void pause();
|
||||||
virtual void seek(double offset);
|
virtual void seek(double offset);
|
||||||
virtual double tell();
|
virtual double tell() const;
|
||||||
virtual bool isPlaying();
|
virtual bool isPlaying() const;
|
||||||
|
|
||||||
class FrameSync;
|
class FrameSync;
|
||||||
class DeltaSync;
|
class DeltaSync;
|
||||||
|
|||||||
@@ -120,6 +120,11 @@ size_t VideoStream::getSize() const
|
|||||||
return sizeof(Frame);
|
return sizeof(Frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool VideoStream::isPlaying() const
|
||||||
|
{
|
||||||
|
return frameSync->isPlaying() && !eos;
|
||||||
|
}
|
||||||
|
|
||||||
void VideoStream::readPage()
|
void VideoStream::readPage()
|
||||||
{
|
{
|
||||||
char *syncBuffer = nullptr;
|
char *syncBuffer = nullptr;
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public:
|
|||||||
const std::string &getFilename() const;
|
const std::string &getFilename() const;
|
||||||
void setSync(FrameSync *frameSync);
|
void setSync(FrameSync *frameSync);
|
||||||
|
|
||||||
|
bool isPlaying() const;
|
||||||
|
|
||||||
void threadedFillBackBuffer(double dt);
|
void threadedFillBackBuffer(double dt);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user