Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
CrendKing committed Jun 17, 2021
1 parent a1a6f69 commit 4293fd1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions avisynth_filter/src/frame_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class FrameHandler {
auto GetSourceFrame(int frameNb) -> PVideoFrame;
auto BeginFlush() -> void;
auto EndFlush(const std::function<void ()> &interim) -> void;
auto Start() -> void;
auto Stop() -> void;
auto StartWorker() -> void;
auto Flush() -> void;
auto GetInputBufferSize() const -> int;
constexpr auto GetSourceFrameNb() const -> int { return _nextSourceFrameNb; }
constexpr auto GetOutputFrameNb() const -> int { return _nextOutputFrameNb; }
Expand Down
16 changes: 8 additions & 8 deletions filter_common/src/frame_handler_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ FrameHandler::FrameHandler(CSynthFilter &filter)
FrameHandler::~FrameHandler() {
if (_workerThread.joinable()) {
_isStopping = true;
Stop();
Flush();
_workerThread.join();
}
}

auto FrameHandler::Start() -> void {
auto FrameHandler::StartWorker() -> void {
if (!_workerThread.joinable()) {
_isStopping = false;
_workerThread = std::thread(&FrameHandler::WorkerProc, this);
}
}

auto FrameHandler::Stop() -> void {
auto FrameHandler::Flush() -> void {
BeginFlush();
EndFlush([]() -> void {
/*
* Stop the script after worker threads are paused and before flushing is done so that no new frame request (GetSourceFrame()) happens.
* And since _isFlushing is still on, existing frame request should also just drain instead of block.
*
* If no stop here, since AddInputSample() no longer adds frame, existing GetSourceFrame() calls will stuck forever.
*/
* Stop the script after worker threads are paused and before flushing is done so that no new frame request (GetSourceFrame()) happens.
* And since _isFlushing is still on, existing frame request should also just drain instead of block.
*
* If no stop here, since AddInputSample() no longer adds frame, existing GetSourceFrame() calls will stuck forever.
*/
MainFrameServer::GetInstance().StopScript();
});
}
Expand Down
4 changes: 2 additions & 2 deletions filter_common/src/input_pin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ auto CSynthFilterInputPin::Active() -> HRESULT {
FrameServerCommon::GetInstance().LinkFrameHandler(_filter.frameHandler.get());
// need reload here instead of CompleteConnect() so that switching video works
MainFrameServer::GetInstance().ReloadScript(_filter.m_pInput->CurrentMediaType(), true);
_filter.frameHandler->Start();
_filter.frameHandler->StartWorker();

return __super::Active();
}

auto CSynthFilterInputPin::Inactive() -> HRESULT {
_filter.frameHandler->Stop();
_filter.frameHandler->Flush();

return __super::Inactive();
}
Expand Down
2 changes: 1 addition & 1 deletion filter_common/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace SynthFilter {
#define FILTER_NAME_WIDE WIDEN(FILTER_NAME_BASE)
#define FILTER_VERSION_MAJOR 1
#define FILTER_VERSION_MINOR 1
#define FILTER_VERSION_PATCH 1
#define FILTER_VERSION_PATCH 2
#define FILTER_VERSION_STRING STRINGIZE(FILTER_VERSION_MAJOR) "." STRINGIZE(FILTER_VERSION_MINOR) "." STRINGIZE(FILTER_VERSION_PATCH) FILTER_VARIANT " # " FILTER_GIT_HASH
}
4 changes: 2 additions & 2 deletions vapoursynth_filter/src/frame_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class FrameHandler {
auto GetSourceFrame(int frameNb) -> const VSFrameRef *;
auto BeginFlush() -> void;
auto EndFlush(const std::function<void ()> &interim) -> void;
auto Start() -> void;
auto Stop() -> void;
auto StartWorker() -> void;
auto Flush() -> void;
auto GetInputBufferSize() const -> int;
constexpr auto GetSourceFrameNb() const -> int { return _nextSourceFrameNb; }
constexpr auto GetOutputFrameNb() const -> int { return _nextOutputFrameNb; }
Expand Down

0 comments on commit 4293fd1

Please sign in to comment.