From 87156f24b83e3f09ad6a1ef71c52694d1c66d994 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 30 Jan 2018 20:17:20 +0000 Subject: [PATCH 1/2] Remove FPS checker --- app/VideoHandle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 1b74471..1102559 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -34,7 +34,7 @@ #include #include -#define _CONTROL_PLAYING_TIME_ 1 +#define _CONTROL_PLAYING_TIME_ 0 class QToolBar; class QDockWidget; From 0a8a31bce8968ab5474df63873d42ebb50d4c540 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 31 Jan 2018 01:32:29 +0000 Subject: [PATCH 2/2] Bugfix: - Fix seek using ffmpeg libs - Fix close of VideoSubWindow --- app/SubWindowAbstract.h | 2 +- app/VideoSubWindow.cpp | 10 ++++++++++ app/VideoSubWindow.h | 2 +- lib/StreamHandlerLibav.cpp | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/SubWindowAbstract.h b/app/SubWindowAbstract.h index 342530a..e46f6eb 100644 --- a/app/SubWindowAbstract.h +++ b/app/SubWindowAbstract.h @@ -136,7 +136,7 @@ public: protected: void focusInEvent( QFocusEvent* event ); - void closeEvent( QCloseEvent* event ); + virtual void closeEvent( QCloseEvent* event ); Void setWidget( QWidget* widget ); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 0bd97b2..d4154c3 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -196,6 +196,12 @@ VideoSubWindow::~VideoSubWindow() * Events handlers */ +Void VideoSubWindow::closeEvent( QCloseEvent* event ) +{ + stop(); + SubWindowAbstract::closeEvent( event ); +} + Void VideoSubWindow::keyPressEvent( QKeyEvent* event ) { if( m_pcCurrentDisplayModule ) @@ -791,6 +797,10 @@ Void VideoSubWindow::seekRelativeEvent( Bool bIsFoward ) Void VideoSubWindow::stop() { +#ifndef QT_NO_CONCURRENT + m_cRefreshResult.waitForFinished(); + m_cReadResult.waitForFinished(); +#endif m_bIsPlaying = false; seekAbsoluteEvent( 0 ); return; diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index f662851..0e9eae9 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -204,7 +204,7 @@ private: protected: Void keyPressEvent( QKeyEvent* event ); Void resizeEvent( QResizeEvent* event ); - // void closeEvent( QCloseEvent *event ); + Void closeEvent( QCloseEvent *event ); public Q_SLOTS: void updateWindowOnTimeout(); diff --git a/lib/StreamHandlerLibav.cpp b/lib/StreamHandlerLibav.cpp index 7d255bd..fe69e42 100644 --- a/lib/StreamHandlerLibav.cpp +++ b/lib/StreamHandlerLibav.cpp @@ -374,6 +374,9 @@ Bool StreamHandlerLibav::write( PlaYUVerFrame* pcFrame ) Bool StreamHandlerLibav::seek( UInt64 iFrameNum ) { + if( m_uiTotalNumberFrames == 1 ) + return true; + if( m_uiCurrFrameFileIdx == iFrameNum ) return true;