summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/file_source_impl.cc
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2017-07-20 10:54:38 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2017-07-20 10:54:38 -0700
commit3a3210ec6e3c7c784dc7a31f87154f53ee036189 (patch)
treeb2cb4a61e1a1a7198a29fed5a00599c5d39dd3d9 /gr-blocks/lib/file_source_impl.cc
parentbd611224ba4c2356c1ad4c3359781682c5c121da (diff)
parentdd1ea1ff8dca65c512cfdb8ca0dbd4711da3f526 (diff)
Merge branch 'maint'
Diffstat (limited to 'gr-blocks/lib/file_source_impl.cc')
-rw-r--r--gr-blocks/lib/file_source_impl.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gr-blocks/lib/file_source_impl.cc b/gr-blocks/lib/file_source_impl.cc
index 9dfd30c016..c077c74fd9 100644
--- a/gr-blocks/lib/file_source_impl.cc
+++ b/gr-blocks/lib/file_source_impl.cc
@@ -115,6 +115,16 @@ namespace gr {
throw std::runtime_error("can't open file");
}
+ //Check to ensure the file will be consumed according to item size
+ fseek(d_new_fp, 0, SEEK_END);
+ int file_size = ftell(d_new_fp);
+ rewind (d_new_fp);
+
+ //Warn the user if part of the file will not be consumed.
+ if(file_size % d_itemsize){
+ GR_LOG_WARN(d_logger, "WARNING: File will not be fully consumed with the current output type");
+ }
+
d_updated = true;
d_repeat = repeat;
}