From 93a5083066207d78926532043baa7720140d1da5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 5 Mar 2007 19:18:24 +0000 Subject: [PATCH] Re-added the "timecode" warning, but only if it is turned on via --engage enable_timecode_warning. --- src/common/hacks.cpp | 1 + src/common/hacks.h | 1 + src/merge/pr_generic.cpp | 14 +++++++------- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/common/hacks.cpp b/src/common/hacks.cpp index 611ff0ff2..d0ac26cb8 100644 --- a/src/common/hacks.cpp +++ b/src/common/hacks.cpp @@ -42,6 +42,7 @@ static const char *mosu_hacks[] = { ENGAGE_USE_SIMPLE_BLOCK, ENGAGE_OLD_AAC_CODECID, ENGAGE_USE_CODEC_STATE, + ENGAGE_ENABLE_TIMECODE_WARNING, NULL }; static vector engaged_hacks; diff --git a/src/common/hacks.h b/src/common/hacks.h index 6311cf43f..bff12826d 100644 --- a/src/common/hacks.h +++ b/src/common/hacks.h @@ -39,6 +39,7 @@ using namespace std; #define ENGAGE_USE_SIMPLE_BLOCK "use_simpleblock" #define ENGAGE_OLD_AAC_CODECID "old_aac_codecid" #define ENGAGE_USE_CODEC_STATE "use_codec_state" +#define ENGAGE_ENABLE_TIMECODE_WARNING "enable_timecode_warning" void MTX_DLL_API engage_hacks(const string &hacks); bool MTX_DLL_API hack_engaged(const string &hack); diff --git a/src/merge/pr_generic.cpp b/src/merge/pr_generic.cpp index a6b18f230..7a5689a25 100644 --- a/src/merge/pr_generic.cpp +++ b/src/merge/pr_generic.cpp @@ -28,6 +28,7 @@ #include "common.h" #include "commonebml.h" #include "compression.h" +#include "hacks.h" #include "mkvmerge.h" #include "output_control.h" #include "pr_generic.h" @@ -914,13 +915,12 @@ generic_packetizer_c::add_packet2(packet_cptr pack) { "contains a bug. In this case you should contact the author " "Moritz Bunkus .\n", ti.fname.c_str(), ti.id, (needed_timecode_offset + 500000) / 1000000); - } -// } else -// mxwarn("pr_generic.cpp/generic_packetizer_c::add_packet(): timecode < " -// "last_timecode (" FMT_TIMECODE " < " FMT_TIMECODE ") for " LLD -// " of '%s'. %s\n", ARG_TIMECODE_NS(pack->timecode), -// ARG_TIMECODE_NS(safety_last_timecode), ti.id, ti.fname.c_str(), -// BUGMSG); + } else if (hack_engaged(ENGAGE_ENABLE_TIMECODE_WARNING)) + mxwarn("pr_generic.cpp/generic_packetizer_c::add_packet(): timecode < " + "last_timecode (" FMT_TIMECODE " < " FMT_TIMECODE ") for " LLD + " of '%s'. %s\n", ARG_TIMECODE_NS(pack->timecode), + ARG_TIMECODE_NS(safety_last_timecode), ti.id, ti.fname.c_str(), + BUGMSG); } safety_last_timecode = pack->timecode; safety_last_duration = pack->duration;