@@ -442,23 +442,9 @@ void FileStorageStreamReader_read(
442
442
struct FileStorageStreamReader * stream_reader =
443
443
(struct FileStorageStreamReader * ) stream_reader_data ;
444
444
int i = 0 ;
445
- /*
446
- * If the last sample was already provided and we are at the end of the file
447
- * we will skip the read operation in order to finalize the execution.
448
- */
449
- if (stream_reader -> current_timestamp == INT64_MAX
450
- && feof (stream_reader -> file_record .file )) {
451
- * count = 0 ;
452
- return ;
453
- }
454
- DDS_LongLong timestamp_limit ;
455
- if (selector -> time_range_end .sec == DDS_TIME_MAX .sec
456
- && selector -> time_range_end .nanosec == DDS_TIME_MAX .nanosec ) {
457
- timestamp_limit = selector -> time_range_end .sec ;
458
- } else {
459
- timestamp_limit = selector -> time_range_end .sec * NANOSECS_PER_SEC ;
460
- timestamp_limit += selector -> time_range_end .nanosec ;
461
- }
445
+ long long timestamp_limit =
446
+ (long long ) selector -> time_range_end .sec * NANOSECS_PER_SEC
447
+ + selector -> time_range_end .nanosec ;
462
448
int read_samples = 0 ;
463
449
/*
464
450
* The value of the sample selector's max samples could be
@@ -475,21 +461,12 @@ void FileStorageStreamReader_read(
475
461
* count = 0 ;
476
462
return ;
477
463
}
478
- /*
479
- * Add the currently read sample and sample info values to the taken data
480
- * and info collections (sequences)
481
- */
464
+ /* Add the currently read sample and sample info values to the taken data
465
+ * and info collections (sequences) */
482
466
do {
483
467
FileStorageStreamReader_addSampleToData (stream_reader );
468
+ FileStorageStreamReader_readSample (stream_reader );
484
469
read_samples ++ ;
485
- /*
486
- * if we reach the end of the file or we cant read a proper sample,
487
- * we dont add that sample on this iteration but we should send the
488
- * previous samples
489
- */
490
- if (FileStorageStreamReader_readSample (stream_reader ) == FALSE) {
491
- break ;
492
- }
493
470
} while (stream_reader -> current_timestamp <= timestamp_limit
494
471
&& read_samples < max_samples );
495
472
/* The number of taken samples is the current length of the data sequence */
@@ -606,7 +583,6 @@ int FileStorageStreamReader_initialize(
606
583
/* Bootstrap the take loop: read the first sample */
607
584
if (!FileStorageStreamReader_readSample (stream_reader )) {
608
585
printf ("Failed to get first sample from file, maybe EOF was reached\n" );
609
- return FALSE;
610
586
}
611
587
612
588
RTI_RecordingServiceStorageStreamReader_initialize (
0 commit comments