mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
BugFix: prevent repeated initialization
This commit is contained in:
@@ -379,11 +379,6 @@ void FrameGrabber::addFrame (GstBuffer *buffer, GstCaps *caps)
|
||||
if (buffer == nullptr)
|
||||
return;
|
||||
|
||||
// first time initialization
|
||||
if (pipeline_ == nullptr) {
|
||||
initializer_ = std::async( FrameGrabber::initialize, this, caps);
|
||||
}
|
||||
|
||||
// initializer ongoing in separate thread
|
||||
if (initializer_.valid()) {
|
||||
// try to get info from initializer
|
||||
@@ -412,6 +407,10 @@ void FrameGrabber::addFrame (GstBuffer *buffer, GstCaps *caps)
|
||||
}
|
||||
}
|
||||
}
|
||||
// first time initialization
|
||||
else if (pipeline_ == nullptr) {
|
||||
initializer_ = std::async( FrameGrabber::initialize, this, caps);
|
||||
}
|
||||
|
||||
// stop if an incompatilble frame buffer given after initialization
|
||||
if (initialized_ && !gst_caps_is_subset( caps_, caps ))
|
||||
|
||||
Reference in New Issue
Block a user