* Only restore the previous playing position when there is a file that is
currently playing; this fixes the the problem I mentioned in a comment in bug #3855. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36224 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -908,7 +908,10 @@ MainWin::OpenPlaylist(const BMessage* playlistArchive)
|
|||||||
|
|
||||||
playlistLocker.Unlock();
|
playlistLocker.Unlock();
|
||||||
|
|
||||||
playlistArchive->FindInt64("position", (int64*)&fInitialSeekPosition);
|
if (currentIndex != -1) {
|
||||||
|
// Restore the current play position only if we have something to play
|
||||||
|
playlistArchive->FindInt64("position", (int64*)&fInitialSeekPosition);
|
||||||
|
}
|
||||||
|
|
||||||
if (IsHidden())
|
if (IsHidden())
|
||||||
Show();
|
Show();
|
||||||
@@ -1051,6 +1054,7 @@ MainWin::GetQuitMessage(BMessage* message)
|
|||||||
message->AddRect("window frame", Frame());
|
message->AddRect("window frame", Frame());
|
||||||
message->AddBool("audio only", !fHasVideo);
|
message->AddBool("audio only", !fHasVideo);
|
||||||
message->AddInt64("creation time", fCreationTime);
|
message->AddInt64("creation time", fCreationTime);
|
||||||
|
|
||||||
if (!fHasVideo && fHasAudio) {
|
if (!fHasVideo && fHasAudio) {
|
||||||
// store playlist, current index and position if this is audio
|
// store playlist, current index and position if this is audio
|
||||||
BMessage playlistArchive;
|
BMessage playlistArchive;
|
||||||
@@ -1061,6 +1065,7 @@ MainWin::GetQuitMessage(BMessage* message)
|
|||||||
|
|
||||||
if (!fPlaylist)
|
if (!fPlaylist)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BAutolock playlistLocker(fPlaylist);
|
BAutolock playlistLocker(fPlaylist);
|
||||||
if (fPlaylist->Archive(&playlistArchive) != B_OK
|
if (fPlaylist->Archive(&playlistArchive) != B_OK
|
||||||
|| playlistArchive.AddInt32("index",
|
|| playlistArchive.AddInt32("index",
|
||||||
@@ -1189,6 +1194,7 @@ MainWin::_PlaylistItemOpened(const PlaylistItemRef& item, status_t result)
|
|||||||
fHasVideo = fController->VideoTrackCount() != 0;
|
fHasVideo = fController->VideoTrackCount() != 0;
|
||||||
fHasAudio = fController->AudioTrackCount() != 0;
|
fHasAudio = fController->AudioTrackCount() != 0;
|
||||||
SetTitle(item->Name().String());
|
SetTitle(item->Name().String());
|
||||||
|
|
||||||
fController->SetTimePosition(fInitialSeekPosition);
|
fController->SetTimePosition(fInitialSeekPosition);
|
||||||
fInitialSeekPosition = 0;
|
fInitialSeekPosition = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user