| 43 | #ifdef FFMS_WIN_DEBUG |
| 44 | |
| 45 | static 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 |
nothing calls this directly
no outgoing calls
no test coverage detected