From 162a8c5945fb38d350b6d47061bf8bf69dfd17d2 Mon Sep 17 00:00:00 2001 From: seife Date: Sun, 22 May 2011 16:25:25 +0000 Subject: [PATCH] sectionsd: add debug method to stop startup until EPG is read This allows for more consistent benchmarking of the event insertion code. It is not intended for usage in normal setup. Read the comment. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1484 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/sectionsd/sectionsd.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sectionsd/sectionsd.cpp b/src/sectionsd/sectionsd.cpp index 88f2ff385..0d5348d45 100644 --- a/src/sectionsd/sectionsd.cpp +++ b/src/sectionsd/sectionsd.cpp @@ -103,6 +103,7 @@ #define TIME_FSEIT_SKIPPING 240 #endif +static bool reader_ready = true; //#define MAX_EVENTS 6000 static unsigned int max_events; // sleep 5 minutes @@ -4701,6 +4702,7 @@ static void *insertEventsfromFile(void *) printf("[sectionsd] Reading Information finished after %ld miliseconds (%d events)\n", time_monotonic_ms()-now, ev_count); } + reader_ready = true; pthread_exit(NULL); } @@ -6894,7 +6896,7 @@ static void *timeThread(void *) while(!sectionsd_stop) { - while (!scanning) { + while (!scanning || !reader_ready) { if(sectionsd_stop) break; sleep(1); @@ -8728,6 +8730,13 @@ void sectionsd_main_thread(void */*data*/) if (slow_addevent) printf("====> USING SLOW ADDEVENT. export 'NO_SLOW_ADDEVENT=1' to avoid <===\n"); + /* for debugging / benchmarking, "export STARTUP_WAIT=true" to wait with startup for + * the EPG loading to finish + * this wil fail badly if no EPG saving / loading is configured! */ + reader_ready = (getenv("STARTUP_WAIT") == NULL); + if (!reader_ready) + printf("====> sectionsd waiting with startup until saved EPG is read <===\n"); + SIlanguage::loadLanguages(); tzset(); // TZ auswerten