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:
Rene Gollent
2008-08-25 00:40:10 +00:00
parent b9f431f1df
commit df5d28d4d9
2 changed files with 25 additions and 22 deletions
+21 -21
View File
@@ -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.