diff options
author | Balint Seeber <balint@ettus.com> | 2014-04-04 09:31:42 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2014-04-06 02:52:00 -0700 |
commit | c3ef245e71e3adcb537a1d635227e30f4b12f4d5 (patch) | |
tree | 482fb6d5a9d306ab7de6fb48a41b95483723bf89 | |
parent | 0844b31da579619d3f7cad6020250eb37e38ba68 (diff) |
blocks: WAV file sink's DTOR is not called, so added 'stop' override to force call of WAV file completion routine (fills in total size in RIFF header)
-rw-r--r-- | gr-blocks/lib/wavfile_sink_impl.cc | 10 | ||||
-rw-r--r-- | gr-blocks/lib/wavfile_sink_impl.h | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gr-blocks/lib/wavfile_sink_impl.cc b/gr-blocks/lib/wavfile_sink_impl.cc index 9a96f7ca3d..57bdb5f291 100644 --- a/gr-blocks/lib/wavfile_sink_impl.cc +++ b/gr-blocks/lib/wavfile_sink_impl.cc @@ -164,11 +164,19 @@ namespace gr { wavfile_sink_impl::~wavfile_sink_impl() { + stop(); + } + + bool wavfile_sink_impl::stop() + { if(d_new_fp) { - fclose(d_new_fp); + fclose(d_new_fp); + d_new_fp = NULL; } close(); + + return true; } int diff --git a/gr-blocks/lib/wavfile_sink_impl.h b/gr-blocks/lib/wavfile_sink_impl.h index 52dfd2259b..0e77f9799e 100644 --- a/gr-blocks/lib/wavfile_sink_impl.h +++ b/gr-blocks/lib/wavfile_sink_impl.h @@ -67,6 +67,9 @@ namespace gr { */ void close_wav(); + protected: + bool stop(); + public: wavfile_sink_impl(const char *filename, int n_channels, |