[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/01: blocks: WAV file sink's DTOR is not
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/01: 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) |
Date: |
Sun, 6 Apr 2014 10:01:14 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit c3ef245e71e3adcb537a1d635227e30f4b12f4d5
Author: Balint Seeber <address@hidden>
Date: Fri Apr 4 09:31:42 2014 -0700
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)
---
gr-blocks/lib/wavfile_sink_impl.cc | 10 +++++++++-
gr-blocks/lib/wavfile_sink_impl.h | 3 +++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/gr-blocks/lib/wavfile_sink_impl.cc
b/gr-blocks/lib/wavfile_sink_impl.cc
index 9a96f7c..57bdb5f 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 52dfd22..0e77f97 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,