Skip to content

Commit

Permalink
Fix the play start "stutter" (again), and make sure we present an err…
Browse files Browse the repository at this point in the history
…or message if we failed to play a file.
  • Loading branch information
elan committed Apr 17, 2012
1 parent 09fb17f commit 64239dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions xbmc/Application.cpp
Expand Up @@ -1990,6 +1990,8 @@ bool CApplication::WaitFrame(unsigned int timeout)

void CApplication::NewFrame()
{
HideBusyIndicator();

#ifdef HAS_SDL
// We just posted another frame. Keep track and notify.
SDL_mutexP(m_frameMutex);
Expand Down Expand Up @@ -2026,7 +2028,10 @@ void CApplication::Render()
unsigned int singleFrameTime = 10; // default limit 100 fps

m_bPresentFrame = false;
if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused())

bool isBusyDialogShowing = ((CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY))->IsDialogRunning();

if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused() && !isBusyDialogShowing)
{
#ifdef HAS_SDL
SDL_mutexP(m_frameMutex);
Expand Down Expand Up @@ -3825,8 +3830,6 @@ bool CApplication::PlayFile(const CFileItem& item, bool bRestart)

void CApplication::FinishPlayingFile(bool bResult, const CStdString& error)
{
HideBusyIndicator();

if(bResult)
{
if (m_iPlaySpeed != 1)
Expand Down Expand Up @@ -3861,8 +3864,10 @@ void CApplication::FinishPlayingFile(bool bResult, const CStdString& error)
}
else
{
HideBusyIndicator();

// Display error message.
if (g_playlistPlayer.GetPlaylist(g_playlistPlayer.GetCurrentPlaylist()).size() == 1)
if (g_playlistPlayer.GetPlaylist(g_playlistPlayer.GetCurrentPlaylist()).size() <= 1)
{
CStdString err = error;
if (err.size() == 0)
Expand Down Expand Up @@ -5364,8 +5369,6 @@ void CApplication::SeekPercentage(float percent)
// SwitchToFullScreen() returns true if a switch is made, else returns false
bool CApplication::SwitchToFullScreen()
{
HideBusyIndicator();

// if playing from the video info window, close it first!
if (g_windowManager.HasModalDialog() && g_windowManager.GetTopMostModalDialogID() == WINDOW_VIDEO_INFO)
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDPlayer.cpp
Expand Up @@ -369,7 +369,7 @@ void CDVDPlayer::OpenFileComplete()
m_bFileOpenComplete = true;

bool ret = true;
if (m_bStop)
if (m_bStop || m_bAbortRequest)
ret = false;

CStdString err;
Expand Down

0 comments on commit 64239dc

Please sign in to comment.