From b67329382754f4b32e08aa399c83a12f65928a57 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 17 Mar 2012 13:56:13 +0100 Subject: [PATCH] dvbsub: ratelimit 'bad start code' messages Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/33a24a25f0d8db231833465470b22b96529a13cc Author: Stefan Seyfried Date: 2012-03-17 (Sat, 17 Mar 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libdvbsub/dvbsub.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libdvbsub/dvbsub.cpp b/lib/libdvbsub/dvbsub.cpp index f86f255fd..2bf1ccbee 100644 --- a/lib/libdvbsub/dvbsub.cpp +++ b/lib/libdvbsub/dvbsub.cpp @@ -247,6 +247,7 @@ static void* reader_thread(void * /*arg*/) int len; uint16_t packlen; uint8_t* buf; + bool bad_startcode = false; dmx = new cDemux(0); #if HAVE_TRIPLEDRAGON @@ -291,9 +292,13 @@ static void* reader_thread(void * /*arg*/) continue; if(memcmp(tmp, "\x00\x00\x01\xbd", 4)) { - sub_debug.print(Debug::VERBOSE, "[subtitles] bad start code: %02x%02x%02x%02x\n", tmp[0], tmp[1], tmp[2], tmp[3]); + if (!bad_startcode) { + sub_debug.print(Debug::VERBOSE, "[subtitles] bad start code: %02x%02x%02x%02x\n", tmp[0], tmp[1], tmp[2], tmp[3]); + bad_startcode = true; + } continue; } + bad_startcode = false; count = 6; packlen = getbits(tmp, 4*8, 16) + 6;