修bug
Some checks are pending
CI / host-build (push) Waiting to run
CI / rk3588-cross-build (push) Waiting to run

This commit is contained in:
sladro 2026-01-05 18:05:15 +08:00
parent 05b8b0319c
commit b4c6cb58ca

View File

@ -4,6 +4,7 @@
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <mutex>
#include <string>
#include <thread>
@ -110,6 +111,22 @@ public:
private:
#if defined(RK3588_ENABLE_FFMPEG)
static bool IContainsNoCase(const char* haystack, const char* needle) {
if (!haystack || !needle) return false;
const size_t nlen = std::strlen(needle);
if (nlen == 0) return true;
for (const char* p = haystack; *p; ++p) {
size_t i = 0;
while (i < nlen && p[i] &&
std::tolower(static_cast<unsigned char>(p[i])) ==
std::tolower(static_cast<unsigned char>(needle[i]))) {
++i;
}
if (i == nlen) return true;
}
return false;
}
static void InstallFfmpegLogFilterOnce() {
static std::once_flag once;
std::call_once(once, []() {
@ -125,11 +142,11 @@ private:
buf[sizeof(buf) - 1] = '\0';
const char* item = avcl ? av_default_item_name(avcl) : "";
if (item && std::strstr(item, "rtsp") != nullptr) {
// Note: item name can be "rtsp" or "RTSP" depending on build.
if (InputRtspNode::IContainsNoCase(item, "rtsp")) {
// Seen during startup/probing on some cameras; not fatal if we later decode fine.
if (std::strstr(buf, "decoding for stream") && std::strstr(buf, "failed")) {
return; // drop
}
if (InputRtspNode::IContainsNoCase(buf, "decoding for stream") && InputRtspNode::IContainsNoCase(buf, "failed")) return;
if (InputRtspNode::IContainsNoCase(buf, "not enough frames to estimate rate")) return;
}
va_list vl_default;