mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-13 19:29:58 +01:00
BugFix Ensure complete close of session upon termination
Async ending of gst pipeline in stream and media player sources caused a crash at termination as source was still not closed when process was ended. Fix is to ask for an immediate termination of gst pipeline upon delete of stream, and to wait for mixer manager to end current session when clearing.
This commit is contained in:
@@ -73,7 +73,7 @@ Stream::Stream()
|
||||
|
||||
Stream::~Stream()
|
||||
{
|
||||
Stream::close();
|
||||
Stream::close(false);
|
||||
|
||||
// cleanup opengl texture
|
||||
if (textureindex_)
|
||||
@@ -368,7 +368,7 @@ void async_terminate( GstElement *p )
|
||||
gst_object_unref ( p );
|
||||
}
|
||||
|
||||
void Stream::close()
|
||||
void Stream::close(bool async)
|
||||
{
|
||||
// not opened?
|
||||
if (!opened_) {
|
||||
@@ -386,7 +386,10 @@ void Stream::close()
|
||||
if (pipeline_ != nullptr) {
|
||||
|
||||
// end pipeline asynchronously
|
||||
std::thread(async_terminate, pipeline_).detach();
|
||||
if (async)
|
||||
std::thread(async_terminate, pipeline_).detach();
|
||||
else
|
||||
async_terminate(pipeline_);
|
||||
|
||||
pipeline_ = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user