From 5d2e36dc92637cf1cd59901381814b8751bbda15 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 23 Jan 2004 19:13:02 +0000 Subject: [PATCH] Do not print warnings when identifying a file. --- src/common/common.cpp | 4 ++++ src/common/common.h | 1 + src/mkvmerge.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/src/common/common.cpp b/src/common/common.cpp index b5ef8e10f..01decbf1e 100644 --- a/src/common/common.cpp +++ b/src/common/common.cpp @@ -50,8 +50,10 @@ using namespace std; #include "common.h" #include "hacks.h" +#include "mkvmerge.h" int verbose = 1; +bool suppress_warnings = false; bitvalue_c::bitvalue_c(int nbitsize) { assert(nbitsize > 0); @@ -1193,6 +1195,8 @@ static bool warning_issued = false; void mxwarn(const char *fmt, ...) { va_list ap; + if (suppress_warnings) + return; va_start(ap, fmt); mxmsg(MXMSG_WARNING, fmt, ap); va_end(ap); diff --git a/src/common/common.h b/src/common/common.h index b6433bbb2..b1511dbcd 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -84,6 +84,7 @@ using namespace std; (int32_t)(t) % 1000 #define ARG_TIMECODE_NS(t) ARG_TIMECODE(t / 1000000) +extern bool MTX_DLL_API suppress_warnings; void MTX_DLL_API fix_format(const char *fmt, string &new_fmt); #if defined(__GNUC__) void MTX_DLL_API die(const char *fmt, ...) diff --git a/src/mkvmerge.cpp b/src/mkvmerge.cpp index 166f6e97f..cc08ed4a1 100644 --- a/src/mkvmerge.cpp +++ b/src/mkvmerge.cpp @@ -1248,6 +1248,7 @@ static void identify(const char *filename) { verbose = 0; identifying = true; + suppress_warnings = true; create_readers(); file->reader->identify();