[Scummvm-git-logs] scummvm master -> a6dc881a78a9b52a672f699bdd58174af37796b5
mduggan
noreply at scummvm.org
Thu Feb 23 04:45:16 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a2a7b3d2d9 VIDEO: Enhance comments for getRate/setRate
b4647bc3f6 VIDEO: Fix rate set on theora decoder, add API to get frame rate.
a6dc881a78 TETRAEDGE: Fix frame rate for Theora videos.
Commit: a2a7b3d2d968345960ab48ada39f8767e9459923
https://github.com/scummvm/scummvm/commit/a2a7b3d2d968345960ab48ada39f8767e9459923
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-23T13:43:29+09:00
Commit Message:
VIDEO: Enhance comments for getRate/setRate
Changed paths:
video/video_decoder.h
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 92ccb61fbda..aa8f54ac4b9 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -114,7 +114,7 @@ public:
void stop();
/**
- * Set the rate of playback.
+ * Set the rate (speed multiplier) of playback.
*
* For instance, a rate of 0 would stop the video, while a rate of 1
* would play the video normally. Passing 2 to this function would
@@ -129,7 +129,8 @@ public:
void setRate(const Common::Rational &rate);
/**
- * Returns the rate at which the video is being played.
+ * Returns the rate (speed multiplier, not frame rate) at which the video
+ * is being played. Defaults to 1.0 when a video is started.
*/
Common::Rational getRate() const { return _playbackRate; }
Commit: b4647bc3f61053921b65ce5282a3c9603423ff4e
https://github.com/scummvm/scummvm/commit/b4647bc3f61053921b65ce5282a3c9603423ff4e
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-23T13:44:07+09:00
Commit Message:
VIDEO: Fix rate set on theora decoder, add API to get frame rate.
PR #4276 incorrectly assumed "rate" was the frame rate of the video, but it
should be the playback rate. Revert that change.
Instead, add an alternate API for fetching frame rate from TheoraDecoder.
Changed paths:
video/theora_decoder.cpp
video/theora_decoder.h
diff --git a/video/theora_decoder.cpp b/video/theora_decoder.cpp
index b9b57912d30..b759ec4bf66 100644
--- a/video/theora_decoder.cpp
+++ b/video/theora_decoder.cpp
@@ -169,7 +169,6 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) {
if (_hasVideo) {
_videoTrack = new TheoraVideoTrack(getDefaultHighColorFormat(), theoraInfo, theoraSetup);
addTrack(_videoTrack);
- setRate(_videoTrack->getFrameRate());
}
th_info_clear(&theoraInfo);
@@ -249,6 +248,12 @@ void TheoraDecoder::readNextPacket() {
ensureAudioBufferSize();
}
+Common::Rational TheoraDecoder::getFrameRate() const {
+ if (_videoTrack)
+ return _videoTrack->getFrameRate();
+ return Common::Rational();
+}
+
TheoraDecoder::TheoraVideoTrack::TheoraVideoTrack(const Graphics::PixelFormat &format, th_info &theoraInfo, th_setup_info *theoraSetup) {
_theoraDecode = th_decode_alloc(&theoraInfo, theoraSetup);
diff --git a/video/theora_decoder.h b/video/theora_decoder.h
index 99b141c3fbd..8979c8670b7 100644
--- a/video/theora_decoder.h
+++ b/video/theora_decoder.h
@@ -70,6 +70,9 @@ public:
bool loadStream(Common::SeekableReadStream *stream);
void close();
+ /** Frames per second of the loaded video. */
+ Common::Rational getFrameRate() const;
+
protected:
void readNextPacket();
Commit: a6dc881a78a9b52a672f699bdd58174af37796b5
https://github.com/scummvm/scummvm/commit/a6dc881a78a9b52a672f699bdd58174af37796b5
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-02-23T13:44:43+09:00
Commit Message:
TETRAEDGE: Fix frame rate for Theora videos.
Changed paths:
engines/tetraedge/te/te_theora.cpp
diff --git a/engines/tetraedge/te/te_theora.cpp b/engines/tetraedge/te/te_theora.cpp
index 3cee78a3f48..5c2f908b265 100644
--- a/engines/tetraedge/te/te_theora.cpp
+++ b/engines/tetraedge/te/te_theora.cpp
@@ -94,14 +94,18 @@ uint TeTheora::topBorderSize() {
}
float TeTheora::frameRate() {
- return _decoder->getRate().toDouble();
+ return _decoder->getFrameRate().toDouble();
}
bool TeTheora::update(uint i, TeImage &imgout) {
+ if (!_decoder->isPlaying())
+ _decoder->start();
+
if (_decoder->getCurFrame() > (int)i && _loadedNode.isReadable()) {
// rewind.. no good way to do that, but it should
// only happen on loop.
load(_loadedNode);
+ _decoder->start();
}
const Graphics::Surface *frame = nullptr;
More information about the Scummvm-git-logs
mailing list