Skip to content
Snippets Groups Projects
Commit 92060d3f authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Alexandre Lision
Browse files

sink: prevent DecodingStopped signal if not started

Arbitrate DRing::VideoSignal::DecodingStopped signal to not
emitting it if not previously started.
This prevents client troubles if they don't handle well
this behavior.

Issue: #81116
Change-Id: Ib08801d2f62795550238bc91810e6bf139376553
parent 57bc2d33
No related branches found
No related tags found
No related merge requests found
......@@ -353,10 +353,12 @@ SinkClient::setFrameSize(int width, int height)
RING_WARN("Start sink <%s / %s>, size=%dx%d, mixer=%u",
getId().c_str(), openedName().c_str(), width, height, mixer_);
emitSignal<DRing::VideoSignal::DecodingStarted>(getId(), openedName(), width, height, mixer_);
} else {
started_ = true;
} else if (started_) {
RING_ERR("Stop sink <%s / %s>, mixer=%u",
getId().c_str(), openedName().c_str(), mixer_);
emitSignal<DRing::VideoSignal::DecodingStopped>(getId(), openedName(), mixer_);
started_ = false;
}
}
......
......@@ -65,6 +65,7 @@ class SinkClient : public VideoFramePassiveReader
private:
const std::string id_;
const bool mixer_;
bool started_ {false}; // used to arbitrate client's stop signal.
std::function<void(int, int)> target_;
std::vector<unsigned char>* targetData_ {nullptr}; // filled by registerTarget, user owned
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment