X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Flib%2Fcc-analyse.c;h=52df66e666019e02c745db16e94e658180d7c339;hb=f49763bf4a6cd8b2a47abfbec7ef3d8c8c029b8f;hp=cdb16f02fc6b619593cbd4c027a7454756ede714;hpb=32d3536706324808df6cd02248a236302b831571;p=fw%2Faltos diff --git a/ao-tools/lib/cc-analyse.c b/ao-tools/lib/cc-analyse.c index cdb16f02..52df66e6 100644 --- a/ao-tools/lib/cc-analyse.c +++ b/ao-tools/lib/cc-analyse.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,6 +19,20 @@ #include "cc.h" #include +void +cc_timedata_limits(struct cc_timedata *d, double min_time, double max_time, int *start, int *stop) +{ + int i; + + *start = -1; + for (i = 0; i < d->num; i++) { + if (*start < 0 && min_time <= d->data[i].time) + *start = i; + if (d->data[i].time <= max_time) + *stop = i; + } +} + int cc_timedata_min(struct cc_timedata *d, double min_time, double max_time) {