diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2017-07-20 10:53:12 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2017-07-20 10:53:12 -0700 |
commit | dd1ea1ff8dca65c512cfdb8ca0dbd4711da3f526 (patch) | |
tree | 4b265d45afbb8aaac777f8d31a423136ff412982 | |
parent | 119de4767b62397a25708311d6acf3bbe0dd2dc9 (diff) | |
parent | a981e0bcd4c7a08f2e25785c5d036f0428417d23 (diff) |
Merge remote-tracking branch 'github/pr/1381' into maint
-rw-r--r-- | gr-blocks/lib/file_source_impl.cc | 10 |
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 1602b02416..cc57a905ed 100644 --- a/gr-blocks/lib/file_source_impl.cc +++ b/gr-blocks/lib/file_source_impl.cc @@ -110,6 +110,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; } |