MCPcopy Create free account
hub / github.com/FFMS/ffms2 / av_log_windebug_callback

Function av_log_windebug_callback

src/core/ffms.cpp:45–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43#ifdef FFMS_WIN_DEBUG
44
45static void av_log_windebug_callback(void* ptr, int level, const char* fmt, va_list vl) {
46 if (level > av_log_get_level())
47 return;
48
49 static int print_prefix = 1;
50 static int count;
51 static char line[1024] = {}, prev[1024] = {};
52 auto avc = ptr ? *static_cast<AVClass **>(ptr) : nullptr;
53
54 int written = 0;
55 if (print_prefix && avc) {
56 written = snprintf(line, sizeof(line), "[%s @ %p]", avc->item_name(ptr), ptr);
57 }
58
59 written += vsnprintf(line + written, sizeof(line) - written, fmt, vl);
60
61 print_prefix = line[written - 1] == '\n';
62 line[sizeof(line) - 1] = 0;
63 if (print_prefix && !strcmp(line, prev)) {
64 count++;
65 return;
66 }
67 if (count > 0) {
68 std::stringstream ss;
69 ss << " Last message repeated " << count << " times\n";
70 OutputDebugStringA(ss.str().c_str());
71 count = 0;
72 }
73 OutputDebugStringA(line);
74 strcpy(prev, line);
75}
76
77#endif
78

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected