Style cleanup.
When asked to toggle playback, PlaybackManager never checked if it had a previous playback state to copy from. This caused a crash if playback was toggled via the keyboard when no file was loaded. Fixes ticket #2664 . git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27194 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -81,33 +81,33 @@ void Controller::Listener::MutedChanged(bool) {}
|
||||
|
||||
|
||||
Controller::Controller()
|
||||
: NodeManager()
|
||||
, fVideoView(NULL)
|
||||
, fVolume(1.0)
|
||||
, fMuted(false)
|
||||
: NodeManager(),
|
||||
fVideoView(NULL),
|
||||
fVolume(1.0),
|
||||
fMuted(false),
|
||||
|
||||
, fRef()
|
||||
, fMediaFile(NULL)
|
||||
fRef(),
|
||||
fMediaFile(NULL),
|
||||
|
||||
, fVideoSupplier(new ProxyVideoSupplier())
|
||||
, fAudioSupplier(new ProxyAudioSupplier(this))
|
||||
, fVideoTrackSupplier(NULL)
|
||||
, fAudioTrackSupplier(NULL)
|
||||
fVideoSupplier(new ProxyVideoSupplier()),
|
||||
fAudioSupplier(new ProxyAudioSupplier(this)),
|
||||
fVideoTrackSupplier(NULL),
|
||||
fAudioTrackSupplier(NULL),
|
||||
|
||||
, fAudioTrackList(4)
|
||||
, fVideoTrackList(2)
|
||||
fAudioTrackList(4),
|
||||
fVideoTrackList(2),
|
||||
|
||||
, fPosition(0)
|
||||
, fDuration(0)
|
||||
, fVideoFrameRate(25.0)
|
||||
, fSeekFrame(-1)
|
||||
, fLastSeekEventTime(LONGLONG_MIN)
|
||||
fPosition(0),
|
||||
fDuration(0),
|
||||
fVideoFrameRate(25.0),
|
||||
fSeekFrame(-1),
|
||||
fLastSeekEventTime(LONGLONG_MIN),
|
||||
|
||||
, fAutoplay(true)
|
||||
, fPauseAtEndOfStream(false)
|
||||
, fSeekToStartAfterPause(false)
|
||||
fAutoplay(true),
|
||||
fPauseAtEndOfStream(false),
|
||||
fSeekToStartAfterPause(false),
|
||||
|
||||
, fListeners(4)
|
||||
fListeners(4)
|
||||
{
|
||||
fStopped = fAutoplay ? false : true;
|
||||
}
|
||||
|
||||
@@ -371,8 +371,11 @@ PlaybackManager::SetCurrentFrame(int64 frame)
|
||||
void
|
||||
PlaybackManager::SetPlayMode(int32 mode, bool continuePlaying)
|
||||
{
|
||||
PlayingState* lastState = _LastState();
|
||||
if (lastState == NULL)
|
||||
return;
|
||||
//printf("PlaybackManager::SetPlayMode(%ld, %d)\n", mode, continuePlaying);
|
||||
PlayingState* newState = new PlayingState(*_LastState());
|
||||
PlayingState* newState = new PlayingState(*lastState);
|
||||
newState->play_mode = mode;
|
||||
// Jump to the playing start frame if we should not continue, where we
|
||||
// stop.
|
||||
|
||||
Reference in New Issue
Block a user