diff --git a/source/app/SubWindowHandle.cpp b/source/app/SubWindowHandle.cpp index c54467e..1e08a1e 100644 --- a/source/app/SubWindowHandle.cpp +++ b/source/app/SubWindowHandle.cpp @@ -208,9 +208,17 @@ Bool SubWindowHandle::save( QString filename ) return iRet; } -Void SubWindowHandle::play() +Bool SubWindowHandle::play() { - m_bIsPlaying = true; + if( m_pCurrStream && m_pCurrStream->getFrameNum() > 1 ) + { + m_bIsPlaying = true; + } + else + { + m_bIsPlaying = false; + } + return m_bIsPlaying; } Int SubWindowHandle::playEvent() diff --git a/source/app/SubWindowHandle.h b/source/app/SubWindowHandle.h index e58b392..6a68ba2 100644 --- a/source/app/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -70,7 +70,7 @@ public: Void reloadFile(); Bool save( QString filename ); - Void play(); + Bool play(); Void pause(); Int playEvent(); Void stop(); diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index a0e1627..09ceea2 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -456,29 +456,26 @@ Void plaYUVerApp::play() if( m_arrayActions[VIDEO_LOCK_ACT]->isChecked() && m_acPlayingSubWindows.size() ) { - Bool bFind = false; - for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + if( !m_acPlayingSubWindows.contains( m_pcCurrentSubWindow ) ) { - if( m_acPlayingSubWindows.at( i ) == m_pcCurrentSubWindow ) + if( !m_pcCurrentSubWindow->play() ) { - bFind = true; - break; + return; } - } - if( !bFind ) - { m_acPlayingSubWindows.append( m_pcCurrentSubWindow ); m_pcCurrentSubWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() ); updateTotalFrameNum(); } - m_pcCurrentSubWindow->play(); } else { m_pcPlayingTimer->stop(); m_acPlayingSubWindows.clear(); + if( !m_pcCurrentSubWindow->play() ) + { + return; + } m_acPlayingSubWindows.append( m_pcCurrentSubWindow ); - m_pcCurrentSubWindow->play(); m_uiAveragePlayInterval = 0; m_bIsPlaying = false; }