diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index c574d69..6905c5a 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -296,6 +296,18 @@ void plaYUVerApp::updatePropertiesSelectedArea( QRect area ) // ----------------------- Playing Functions -------------------- +UInt plaYUVerApp::getMaxFrameNumber() +{ + UInt currFrames; + UInt maxFrames = INT_MAX; + for( Int i = 0; i < m_acPlayingSubWindows.size(); i++ ) + { + currFrames = m_acPlayingSubWindows.at( i )->getInputStream()->getFrameNum(); + if( currFrames < maxFrames ) + maxFrames = currFrames; + } + return maxFrames; +} Void plaYUVerApp::setTimerStatus() { Bool status = false; @@ -337,7 +349,7 @@ void plaYUVerApp::play() m_acPlayingSubWindows.append( m_pcCurrentSubWindow ); m_pcCurrentSubWindow->seekAbsoluteEvent( m_acPlayingSubWindows.at( 0 )->getInputStream()->getCurrFrameNum() ); m_pcCurrentSubWindow->play(); - m_pcFrameSlider->setMaximum( qMin( m_pcFrameSlider->maximum(), ( Int )m_pcCurrentSubWindow->getInputStream()->getFrameNum() - 1 ) ); + m_pcFrameSlider->setMaximum( getMaxFrameNumber() - 1 ); } } else @@ -543,7 +555,6 @@ Void plaYUVerApp::zoomToFitAll() } } - void plaYUVerApp::scaleFrame( int ratio ) { if( activeSubWindow() ) diff --git a/source/app/plaYUVerApp.h b/source/app/plaYUVerApp.h index 4aa9bab..aa1cfe8 100644 --- a/source/app/plaYUVerApp.h +++ b/source/app/plaYUVerApp.h @@ -121,6 +121,7 @@ private: Void zoomToFitAll(); //! Playing functions + UInt getMaxFrameNumber(); Void setTimerStatus(); Void updateCurrFrameNum(); Void updateTotalFrameNum( UInt total_frame_num = 0 );