projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: seek by timestamp
[babeltrace.git]
/
lib
/
iterator.c
diff --git
a/lib/iterator.c
b/lib/iterator.c
index 3dbe878846ab3699af938d2e3a98c202eca8d7b3..0af151402b429d3fe95d9c92c42e9e07eb9436f5 100644
(file)
--- a/
lib/iterator.c
+++ b/
lib/iterator.c
@@
-110,8
+110,7
@@
static int seek_file_stream_by_timestamp(struct ctf_file_stream *cfs,
for (i = 0; i < stream_pos->packet_index->len; i++) {
index = &g_array_index(stream_pos->packet_index,
struct packet_index, i);
for (i = 0; i < stream_pos->packet_index->len; i++) {
index = &g_array_index(stream_pos->packet_index,
struct packet_index, i);
- if (index->timestamp_begin >= timestamp ||
- index->timestamp_end <= timestamp)
+ if (index->timestamp_end <= timestamp)
continue;
stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET);
continue;
stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET);
@@
-177,7
+176,7
@@
int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos)
switch (iter_pos->type) {
case BT_SEEK_RESTORE:
if (!iter_pos->u.restore)
switch (iter_pos->type) {
case BT_SEEK_RESTORE:
if (!iter_pos->u.restore)
-
goto error_arg
;
+
return -EINVAL
;
heap_free(iter->stream_heap);
ret = heap_init(iter->stream_heap, 0, stream_compare);
heap_free(iter->stream_heap);
ret = heap_init(iter->stream_heap, 0, stream_compare);
@@
-228,9
+227,6
@@
int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos)
case BT_SEEK_TIME:
tc = iter->ctx->tc;
case BT_SEEK_TIME:
tc = iter->ctx->tc;
- if (!iter_pos->u.seek_time)
- goto error_arg;
-
heap_free(iter->stream_heap);
ret = heap_init(iter->stream_heap, 0, stream_compare);
if (ret < 0)
heap_free(iter->stream_heap);
ret = heap_init(iter->stream_heap, 0, stream_compare);
if (ret < 0)
@@
-253,13
+249,11
@@
int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos)
return 0;
default:
/* not implemented */
return 0;
default:
/* not implemented */
-
goto error_arg
;
+
return -EINVAL
;
}
return 0;
}
return 0;
-error_arg:
- ret = -EINVAL;
error:
heap_free(iter->stream_heap);
if (heap_init(iter->stream_heap, 0, stream_compare) < 0) {
error:
heap_free(iter->stream_heap);
if (heap_init(iter->stream_heap, 0, stream_compare) < 0) {
This page took
0.024296 seconds
and
4
git commands to generate.