aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/extractor.c17
-rw-r--r--src/main/extractor_ipc_gnu.c2
-rw-r--r--src/main/extractor_ipc_w32.c16
-rw-r--r--src/main/extractor_logging.h2
-rw-r--r--src/main/extractor_plugin_main.c30
-rw-r--r--src/main/extractor_plugins.c43
6 files changed, 7 insertions, 103 deletions
diff --git a/src/main/extractor.c b/src/main/extractor.c
index 09a99e9..830eac8 100644
--- a/src/main/extractor.c
+++ b/src/main/extractor.c
@@ -35,7 +35,7 @@
35/** 35/**
36 * Size used for the shared memory segment. 36 * Size used for the shared memory segment.
37 */ 37 */
38#define DEFAULT_SHM_SIZE (160 * 1024) 38#define DEFAULT_SHM_SIZE (16 * 1024)
39 39
40 40
41/** 41/**
@@ -382,8 +382,6 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
382 ssize_t ready; 382 ssize_t ready;
383 int done; 383 int done;
384 int have_in_memory; 384 int have_in_memory;
385
386 LOG ("Stating !\n");
387 385
388 plugin_count = 0; 386 plugin_count = 0;
389 for (pos = plugins; NULL != pos; pos = pos->next) 387 for (pos = plugins; NULL != pos; pos = pos->next)
@@ -403,7 +401,6 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
403 start.reserved2 = 0; 401 start.reserved2 = 0;
404 start.shm_ready_bytes = (uint32_t) ready; 402 start.shm_ready_bytes = (uint32_t) ready;
405 start.file_size = EXTRACTOR_datasource_get_size_ (ds, 0); 403 start.file_size = EXTRACTOR_datasource_get_size_ (ds, 0);
406 LOG ("Have %d\ !\n",plugin_count);
407 for (pos = plugins; NULL != pos; pos = pos->next) 404 for (pos = plugins; NULL != pos; pos = pos->next)
408 { 405 {
409 if (EXTRACTOR_OPTION_IN_PROCESS == pos->flags) 406 if (EXTRACTOR_OPTION_IN_PROCESS == pos->flags)
@@ -427,7 +424,6 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
427 done = 0; 424 done = 0;
428 while (! done) 425 while (! done)
429 { 426 {
430 //LOG ("In !done while\n");
431 struct EXTRACTOR_Channel *channels[plugin_count]; 427 struct EXTRACTOR_Channel *channels[plugin_count];
432 428
433 /* calculate current 'channels' array */ 429 /* calculate current 'channels' array */
@@ -437,18 +433,15 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
437 if (-1 == pos->seek_request) 433 if (-1 == pos->seek_request)
438 { 434 {
439 /* channel is not seeking, must be running or done */ 435 /* channel is not seeking, must be running or done */
440 //LOG ("No seeking, done\n");
441 channels[plugin_off] = pos->channel; 436 channels[plugin_off] = pos->channel;
442 } 437 }
443 else 438 else
444 { 439 {
445 /* not running this round, seeking! */ 440 /* not running this round, seeking! */
446 //LOG ("Nor running, seeking\n");
447 channels[plugin_off] = NULL; 441 channels[plugin_off] = NULL;
448 } 442 }
449 plugin_off++; 443 plugin_off++;
450 } 444 }
451 //LOG ("Will call EXTRACTOR_IPC_channel_recv_\n");
452 /* give plugins chance to send us meta data, seek or finished messages */ 445 /* give plugins chance to send us meta data, seek or finished messages */
453 if (-1 == 446 if (-1 ==
454 EXTRACTOR_IPC_channel_recv_ (channels, 447 EXTRACTOR_IPC_channel_recv_ (channels,
@@ -457,7 +450,7 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
457 &prp)) 450 &prp))
458 { 451 {
459 /* serious problem in IPC; reset *all* channels */ 452 /* serious problem in IPC; reset *all* channels */
460 //LOG ("Failed to receive message from channels; full reset\n"); 453 LOG ("Failed to receive message from channels; full reset\n");
461 abort_all_channels (plugins); 454 abort_all_channels (plugins);
462 break; 455 break;
463 } 456 }
@@ -470,14 +463,10 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
470 { 463 {
471 plugin_off++; 464 plugin_off++;
472 if ( (1 == pos->round_finished) || 465 if ( (1 == pos->round_finished) ||
473 (NULL == pos->channel) ){ 466 (NULL == pos->channel) )
474 //LOG ("Inative plugin\n");
475 continue; /* inactive plugin */ 467 continue; /* inactive plugin */
476
477 }
478 if (-1 == pos->seek_request) 468 if (-1 == pos->seek_request)
479 { 469 {
480 //LOG ("pos->seek_request\n");
481 /* possibly more meta data at current position, at least 470 /* possibly more meta data at current position, at least
482 this plugin is still working on it... */ 471 this plugin is still working on it... */
483 done = 0; 472 done = 0;
diff --git a/src/main/extractor_ipc_gnu.c b/src/main/extractor_ipc_gnu.c
index c39e08b..313120f 100644
--- a/src/main/extractor_ipc_gnu.c
+++ b/src/main/extractor_ipc_gnu.c
@@ -464,7 +464,7 @@ EXTRACTOR_IPC_channel_recv_ (struct EXTRACTOR_Channel **channels,
464 return 1; /* nothing left to do! */ 464 return 1; /* nothing left to do! */
465 } 465 }
466 tv.tv_sec = 0; 466 tv.tv_sec = 0;
467 tv.tv_usec = 5000000; /* 500 ms */ 467 tv.tv_usec = 500000; /* 500 ms */
468 if (0 >= select (max + 1, &to_check, NULL, NULL, &tv)) 468 if (0 >= select (max + 1, &to_check, NULL, NULL, &tv))
469 { 469 {
470 /* an error or timeout -> something's wrong or all plugins hung up */ 470 /* an error or timeout -> something's wrong or all plugins hung up */
diff --git a/src/main/extractor_ipc_w32.c b/src/main/extractor_ipc_w32.c
index 600dbdd..c4b8284 100644
--- a/src/main/extractor_ipc_w32.c
+++ b/src/main/extractor_ipc_w32.c
@@ -725,17 +725,12 @@ EXTRACTOR_IPC_channel_recv_ (struct EXTRACTOR_Channel **channels,
725 if (c == 0) 725 if (c == 0)
726 return 1; /* nothing left to do! */ 726 return 1; /* nothing left to do! */
727 727
728 ms = 1000000; 728 ms = 10000;
729 first_ready = WaitForMultipleObjects (c, events, FALSE, ms); 729 first_ready = WaitForMultipleObjects (c, events, FALSE, ms);
730 if (first_ready == WAIT_TIMEOUT || first_ready == WAIT_FAILED) 730 if (first_ready == WAIT_TIMEOUT || first_ready == WAIT_FAILED)
731 { 731 {
732 /* an error or timeout -> something's wrong or all plugins hung up */ 732 /* an error or timeout -> something's wrong or all plugins hung up */
733 LOG_STRERROR ("WaitForMultipleObjects"); 733 LOG_STRERROR ("WaitForMultipleObjects");
734 FILE *f;
735 f = fopen("debug.txt", "a+");
736 fprintf(f, "WaitForMultipleObjects \n");
737 fclose(f);
738
739 return -1; 734 return -1;
740 } 735 }
741 736
@@ -754,10 +749,6 @@ EXTRACTOR_IPC_channel_recv_ (struct EXTRACTOR_Channel **channels,
754 if (MAX_META_DATA == channels[i]->mdata_size) 749 if (MAX_META_DATA == channels[i]->mdata_size)
755 { 750 {
756 LOG ("Inbound message from channel too large, aborting\n"); 751 LOG ("Inbound message from channel too large, aborting\n");
757 FILE *f;
758 f = fopen("debug.txt", "a+");
759 fprintf(f, "Inbound message from channel too large, aborting \n");
760 fclose(f);
761 EXTRACTOR_IPC_channel_destroy_ (channels[i]); 752 EXTRACTOR_IPC_channel_destroy_ (channels[i]);
762 channels[i] = NULL; 753 channels[i] = NULL;
763 } 754 }
@@ -770,11 +761,6 @@ EXTRACTOR_IPC_channel_recv_ (struct EXTRACTOR_Channel **channels,
770 LOG_STRERROR ("realloc"); 761 LOG_STRERROR ("realloc");
771 EXTRACTOR_IPC_channel_destroy_ (channels[i]); 762 EXTRACTOR_IPC_channel_destroy_ (channels[i]);
772 channels[i] = NULL; 763 channels[i] = NULL;
773
774 FILE *f;
775 f = fopen("debug.txt", "a+");
776 fprintf(f, "Realloc \n");
777 fclose(f);
778 } 764 }
779 channels[i]->mdata = ndata; 765 channels[i]->mdata = ndata;
780 } 766 }
diff --git a/src/main/extractor_logging.h b/src/main/extractor_logging.h
index 54a6564..bf7a964 100644
--- a/src/main/extractor_logging.h
+++ b/src/main/extractor_logging.h
@@ -25,7 +25,7 @@
25#ifndef EXTRACTOR_LOGGING_H 25#ifndef EXTRACTOR_LOGGING_H
26#define EXTRACTOR_LOGGING_H 26#define EXTRACTOR_LOGGING_H
27 27
28#define DEBUG 1 28#define DEBUG 0
29 29
30#if DEBUG 30#if DEBUG
31 31
diff --git a/src/main/extractor_plugin_main.c b/src/main/extractor_plugin_main.c
index 4f6c77c..c56dfab 100644
--- a/src/main/extractor_plugin_main.c
+++ b/src/main/extractor_plugin_main.c
@@ -460,7 +460,6 @@ handle_start_message (struct ProcessingContext *pc)
460 LOG ("Failed to read 'start' message\n"); 460 LOG ("Failed to read 'start' message\n");
461 return -1; 461 return -1;
462 } 462 }
463 fprintf (stderr, "Got start msg\n");
464 pc->shm_ready_bytes = start.shm_ready_bytes; 463 pc->shm_ready_bytes = start.shm_ready_bytes;
465 pc->file_size = start.file_size; 464 pc->file_size = start.file_size;
466 pc->read_position = 0; 465 pc->read_position = 0;
@@ -476,10 +475,6 @@ handle_start_message (struct ProcessingContext *pc)
476 if (-1 == EXTRACTOR_write_all_ (pc->out, &done, sizeof (done))) 475 if (-1 == EXTRACTOR_write_all_ (pc->out, &done, sizeof (done)))
477 { 476 {
478 LOG ("Failed to write 'done' message\n"); 477 LOG ("Failed to write 'done' message\n");
479 FILE *f;
480 f = fopen("debug.txt", "a+");
481 fprintf(f, "Failed to write 'done' message' \n");
482 fclose(f);
483 return -1; 478 return -1;
484 } 479 }
485 if ( (NULL != pc->plugin->specials) && 480 if ( (NULL != pc->plugin->specials) &&
@@ -529,33 +524,18 @@ process_requests (struct ProcessingContext *pc)
529 if (0 != handle_start_message (pc)) 524 if (0 != handle_start_message (pc))
530 { 525 {
531 LOG ("Failure to handle START\n"); 526 LOG ("Failure to handle START\n");
532 FILE *f;
533 f = fopen("debug.txt", "a+");
534 fprintf(f, "Failure to handle START' \n");
535 fclose(f);
536 return; 527 return;
537 } 528 }
538 break; 529 break;
539 case MESSAGE_UPDATED_SHM:{ 530 case MESSAGE_UPDATED_SHM:
540 LOG ("Illegal message\n"); 531 LOG ("Illegal message\n");
541 /* not allowed here, we're not waiting for SHM to move! */ 532 /* not allowed here, we're not waiting for SHM to move! */
542 FILE *f;
543 f = fopen("debug.txt", "a+");
544 fprintf(f, "Illegal message' \n");
545 fclose(f);
546
547 return; 533 return;
548 }
549 case MESSAGE_DISCARD_STATE: 534 case MESSAGE_DISCARD_STATE:
550 /* odd, we're already in the start state... */ 535 /* odd, we're already in the start state... */
551 continue; 536 continue;
552 default: 537 default:
553 LOG ("Received invalid messag %d\n", (int) code); 538 LOG ("Received invalid messag %d\n", (int) code);
554 FILE *f;
555 f = fopen("debug.txt", "a+");
556 fprintf(f, "Received invalid messag' \n");
557 fclose(f);
558
559 /* error, unexpected message */ 539 /* error, unexpected message */
560 return; 540 return;
561 } 541 }
@@ -645,14 +625,6 @@ EXTRACTOR_plugin_main_ (struct EXTRACTOR_PluginList *plugin,
645 process_requests (&pc); 625 process_requests (&pc);
646 LOG ("IPC error; plugin `%s' terminates!\n", 626 LOG ("IPC error; plugin `%s' terminates!\n",
647 plugin->short_libname); 627 plugin->short_libname);
648
649
650 FILE *f;
651 f = fopen("debug.txt", "a+");
652 fprintf(f, "IPC error; plugin `%s' terminates!\n",
653 plugin->short_libname);
654 fclose(f);
655
656#if WINDOWS 628#if WINDOWS
657 if (NULL != pc.shm) 629 if (NULL != pc.shm)
658 UnmapViewOfFile (pc.shm); 630 UnmapViewOfFile (pc.shm);
diff --git a/src/main/extractor_plugins.c b/src/main/extractor_plugins.c
index 444c051..290d511 100644
--- a/src/main/extractor_plugins.c
+++ b/src/main/extractor_plugins.c
@@ -120,14 +120,6 @@ get_symbol_with_prefix (void *lib_handle,
120int 120int
121EXTRACTOR_plugin_load_ (struct EXTRACTOR_PluginList *plugin) 121EXTRACTOR_plugin_load_ (struct EXTRACTOR_PluginList *plugin)
122{ 122{
123
124LOG ("In EXTRACTOR_plugin_load_");
125
126 FILE *f;
127 f = fopen("debug.txt", "a+");
128 fprintf(f, "EXTRACTOR_plugin_load_\n");
129 fclose(f);
130
131#if WINDOWS 123#if WINDOWS
132 wchar_t wlibname[4097]; 124 wchar_t wlibname[4097];
133 char llibname[4097]; 125 char llibname[4097];
@@ -145,11 +137,6 @@ LOG ("In EXTRACTOR_plugin_load_");
145 plugin->flags = EXTRACTOR_OPTION_DISABLED; 137 plugin->flags = EXTRACTOR_OPTION_DISABLED;
146 return -1; 138 return -1;
147 } 139 }
148
149 LOG ("Loading plugin `%s' \n", plugin->short_libname);
150 lt_dlclose (plugin->libraryHandle);
151
152
153 lt_dladvise_init (&advise); 140 lt_dladvise_init (&advise);
154 lt_dladvise_ext (&advise); 141 lt_dladvise_ext (&advise);
155 lt_dladvise_local (&advise); 142 lt_dladvise_local (&advise);
@@ -164,11 +151,6 @@ LOG ("In EXTRACTOR_plugin_load_");
164 LOG ("Loading `%s' plugin failed: %s\n", 151 LOG ("Loading `%s' plugin failed: %s\n",
165 plugin->short_libname, 152 plugin->short_libname,
166 "can't convert plugin name to local encoding"); 153 "can't convert plugin name to local encoding");
167 FILE *f;
168 f = fopen("debug.txt", "a+");
169 fprintf(f, "Loading `%s' plugin failed!\n",
170 plugin->short_libname);
171 fclose(f);
172 free (plugin->libname); 154 free (plugin->libname);
173 plugin->libname = NULL; 155 plugin->libname = NULL;
174 plugin->flags = EXTRACTOR_OPTION_DISABLED; 156 plugin->flags = EXTRACTOR_OPTION_DISABLED;
@@ -207,15 +189,6 @@ LOG ("In EXTRACTOR_plugin_load_");
207 plugin->flags = EXTRACTOR_OPTION_DISABLED; 189 plugin->flags = EXTRACTOR_OPTION_DISABLED;
208 return -1; 190 return -1;
209 } 191 }
210
211 LOG ("Loaded plugin `%s' \n", plugin->short_libname);
212
213
214 f = fopen("debug.txt", "a+");
215 fprintf(f, "Loaded plugin `%s' \n", plugin->short_libname);
216 fclose(f);
217
218
219 return 0; 192 return 0;
220} 193}
221 194
@@ -238,12 +211,6 @@ EXTRACTOR_plugin_add (struct EXTRACTOR_PluginList *prev,
238 struct EXTRACTOR_PluginList *plugin; 211 struct EXTRACTOR_PluginList *plugin;
239 struct EXTRACTOR_PluginList *pos; 212 struct EXTRACTOR_PluginList *pos;
240 char *libname; 213 char *libname;
241
242 FILE *f;
243 f = fopen("debug.txt", "a+");
244 fprintf(f, "EXTRACTOR_plugin_add\n");
245 fclose(f);
246
247 214
248 for (pos = prev; NULL != pos; pos = pos->next) 215 for (pos = prev; NULL != pos; pos = pos->next)
249 if (0 == strcmp (pos->short_libname, library)) 216 if (0 == strcmp (pos->short_libname, library))
@@ -377,9 +344,6 @@ EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev,
377 struct EXTRACTOR_PluginList *pos; 344 struct EXTRACTOR_PluginList *pos;
378 struct EXTRACTOR_PluginList *first; 345 struct EXTRACTOR_PluginList *first;
379 346
380
381
382
383 pos = prev; 347 pos = prev;
384 first = prev; 348 first = prev;
385 while ( (NULL != pos) && 349 while ( (NULL != pos) &&
@@ -394,13 +358,6 @@ EXTRACTOR_plugin_remove (struct EXTRACTOR_PluginList *prev,
394 library); 358 library);
395 return first; 359 return first;
396 } 360 }
397
398 FILE *f;
399 f = fopen("debug.txt", "a+");
400 fprintf(f, "Closoing %s\n",pos->short_libname);
401 fclose(f);
402
403
404 /* found, close library */ 361 /* found, close library */
405 if (first == pos) 362 if (first == pos)
406 first = pos->next; 363 first = pos->next;