mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 04:08:57 +08:00
修复video stack相关功能bug
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
/index/api/stack/reset 在相同url和通分辨率多次调用channel析构没画面的问题 是在 VideoStackManager::parseParams 函数里 多次 (*params)[i * cols + j] = nullptr; 导致 channel 计数器为0,析构没画面。 同时修复cpu占用过高问题。
This commit is contained in:
parent
4c90a1a95b
commit
5c80c75ed9
@ -23,7 +23,11 @@
|
||||
|
||||
INSTANCE_IMP(VideoStackManager)
|
||||
|
||||
Param::~Param() { VideoStackManager::Instance().unrefChannel(id, width, height, pixfmt); }
|
||||
Param::~Param() {
|
||||
auto strongChn= weak_chn.lock();
|
||||
if (!strongChn) { return; }
|
||||
VideoStackManager::Instance().unrefChannel(id, width, height, pixfmt);
|
||||
}
|
||||
|
||||
Channel::Channel(const std::string& id, int width, int height, AVPixelFormat pixfmt)
|
||||
: _id(id), _width(width), _height(height), _pixfmt(pixfmt) {
|
||||
@ -278,6 +282,8 @@ void VideoStack::start() {
|
||||
|
||||
_dev->inputYUV((char**)_buffer->get()->data, _buffer->get()->linesize, pts);
|
||||
pts += frameInterval;
|
||||
} else {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user