aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-08-06 11:37:51 +0000
committerChristian Grothoff <christian@grothoff.org>2012-08-06 11:37:51 +0000
commitccfe044880892da1a23949ac528c971f2df3590d (patch)
treed1742956d15f6981dab63c2e603aef5f82c5d498
parent583739b625c536b3cca310f234b3fe2e4d10620b (diff)
downloadlibextractor-ccfe044880892da1a23949ac528c971f2df3590d.tar.gz
libextractor-ccfe044880892da1a23949ac528c971f2df3590d.zip
do not re-use plugin_count as it is used for array size
-rw-r--r--src/main/extractor.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main/extractor.c b/src/main/extractor.c
index 6dfe27d..a1bcc04 100644
--- a/src/main/extractor.c
+++ b/src/main/extractor.c
@@ -366,6 +366,7 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
366 EXTRACTOR_MetaDataProcessor proc, void *proc_cls) 366 EXTRACTOR_MetaDataProcessor proc, void *proc_cls)
367{ 367{
368 unsigned int plugin_count; 368 unsigned int plugin_count;
369 unsigned int plugin_off;
369 struct EXTRACTOR_PluginList *pos; 370 struct EXTRACTOR_PluginList *pos;
370 struct StartMessage start; 371 struct StartMessage start;
371 struct EXTRACTOR_Channel *channel; 372 struct EXTRACTOR_Channel *channel;
@@ -423,22 +424,21 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
423 struct EXTRACTOR_Channel *channels[plugin_count]; 424 struct EXTRACTOR_Channel *channels[plugin_count];
424 425
425 /* calculate current 'channels' array */ 426 /* calculate current 'channels' array */
426 plugin_count = 0; 427 plugin_off = 0;
427 for (pos = plugins; NULL != pos; pos = pos->next) 428 for (pos = plugins; NULL != pos; pos = pos->next)
428 { 429 {
429 if (-1 == pos->seek_request) 430 if (-1 == pos->seek_request)
430 { 431 {
431 /* channel is not seeking, must be running or done */ 432 /* channel is not seeking, must be running or done */
432 channels[plugin_count] = pos->channel; 433 channels[plugin_off] = pos->channel;
433 } 434 }
434 else 435 else
435 { 436 {
436 /* not running this round, seeking! */ 437 /* not running this round, seeking! */
437 channels[plugin_count] = NULL; 438 channels[plugin_off] = NULL;
438 } 439 }
439 plugin_count++; 440 plugin_off++;
440 } 441 }
441
442 /* give plugins chance to send us meta data, seek or finished messages */ 442 /* give plugins chance to send us meta data, seek or finished messages */
443 if (-1 == 443 if (-1 ==
444 EXTRACTOR_IPC_channel_recv_ (channels, 444 EXTRACTOR_IPC_channel_recv_ (channels,
@@ -455,10 +455,10 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
455 /* calculate minimum seek request (or set done=0 to continue here) */ 455 /* calculate minimum seek request (or set done=0 to continue here) */
456 done = 1; 456 done = 1;
457 min_seek = -1; 457 min_seek = -1;
458 plugin_count = 0; 458 plugin_off = 0;
459 for (pos = plugins; NULL != pos; pos = pos->next) 459 for (pos = plugins; NULL != pos; pos = pos->next)
460 { 460 {
461 if ( (NULL == channels[plugin_count]) && 461 if ( (NULL == channels[plugin_off]) &&
462 (-1 == pos->seek_request) ) 462 (-1 == pos->seek_request) )
463 { 463 {
464 /* EXTRACTOR_IPC_channel_recv_ got a non-NULL channel (-1 == seek_request) 464 /* EXTRACTOR_IPC_channel_recv_ got a non-NULL channel (-1 == seek_request)
@@ -466,7 +466,7 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
466 so we need to update the plugin accordingly */ 466 so we need to update the plugin accordingly */
467 pos->channel = NULL; 467 pos->channel = NULL;
468 } 468 }
469 plugin_count++; 469 plugin_off++;
470 if ( (1 == pos->round_finished) || 470 if ( (1 == pos->round_finished) ||
471 (NULL == pos->channel) ) 471 (NULL == pos->channel) )
472 continue; /* inactive plugin */ 472 continue; /* inactive plugin */
@@ -569,7 +569,6 @@ do_extract (struct EXTRACTOR_PluginList *plugins,
569 LOG ("Failed to seek to 0 for in-memory plugins\n"); 569 LOG ("Failed to seek to 0 for in-memory plugins\n");
570 return; 570 return;
571 } 571 }
572
573 for (pos = plugins; NULL != pos; pos = pos->next) 572 for (pos = plugins; NULL != pos; pos = pos->next)
574 { 573 {
575 if (EXTRACTOR_OPTION_IN_PROCESS != pos->flags) 574 if (EXTRACTOR_OPTION_IN_PROCESS != pos->flags)