DIRECTOR: Setting loop for stopped DV should actually play it

This commit is contained in:
Eugene Sandulenko 2020-08-22 18:01:40 +02:00
parent d1b0c5a986
commit f6f669c953
3 changed files with 11 additions and 2 deletions

View File

@ -355,8 +355,6 @@ Graphics::MacWidget *DigitalVideoCastMember::createWidget(Common::Rect &bbox, Ch
_channel = channel;
warning("creating");
if (!_video || !_video->isVideoLoaded()) {
warning("DigitalVideoCastMember::createWidget: No video decoder");
delete widget;
@ -453,10 +451,15 @@ void DigitalVideoCastMember::setMovieRate(double rate) {
if (!_video)
return;
_channel->_movieRate = rate;
if (rate < 0.0)
warning("STUB: DigitalVideoCastMember::setMovieRate(%g)", rate);
else
_video->setRate(Common::Rational((int)(rate * 100.0), 100));
if (_video->endOfVideo())
_video->rewind();
}
void DigitalVideoCastMember::setFrameRate(int rate) {

View File

@ -23,6 +23,8 @@
#ifndef DIRECTOR_CHANNEL_H
#define DIRECTOR_CHANNEL_H
#include "director/cursor.h"
namespace Graphics {
struct Surface;
class ManagedSurface;

View File

@ -24,6 +24,7 @@
#include "director/director.h"
#include "director/cast.h"
#include "director/channel.h"
#include "director/castmember.h"
#include "director/window.h"
#include "director/util.h"
@ -738,6 +739,9 @@ bool DigitalVideoCastMember::setField(int field, const Datum &d) {
return true;
case kTheLoop:
_looping = (bool)d.asInt();
if (_looping && _channel && _channel->_movieRate == 0.0) {
setMovieRate(1.0);
}
return true;
case kThePausedAtStart:
_pausedAtStart = (bool)d.asInt();