X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=3ce428c387681db74cefadffd0f861daad43aba0;hp=80bd37869ed897f947c1b99e3f871b3d93d9692d;hb=90fcbacc6eb672f0d5e0c9d6722d397ac9f1a63e;hpb=d40a9bb4c13a7ab2be5482d9632346f426229149 diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 80bd3786..3ce428c3 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -229,6 +229,11 @@ int ctf_read_event(struct stream_pos *ppos, struct ctf_stream *stream) ctf_pos_get_event(pos); + /* save the current position as a restore point */ + pos->last_offset = pos->offset; + /* we just read the event, it is consumed when used by the caller */ + stream->consumed = 0; + /* * This is the EOF check after we've advanced the position in * ctf_pos_get_event. @@ -507,8 +512,8 @@ void ctf_move_pos_slow(struct ctf_stream_pos *pos, size_t offset, int whence) break; } case SEEK_SET: - assert(offset == 0); /* only seek supported for now */ - pos->cur_index = 0; + if (offset == 0) + pos->cur_index = 0; file_stream->parent.prev_timestamp = 0; file_stream->parent.prev_timestamp_end = 0; break;