diff options
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r-- | gnuradio-core/src/lib/io/gr_wavfile_sink.cc | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/io/gr_wavfile_sink.h | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc index a96aadc72..88b232343 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc +++ b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc @@ -184,6 +184,7 @@ gr_wavfile_sink::work (int noutput_items, int nwritten; + gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this block do_update(); // update: d_fp is reqd if (!d_fp) // drop output on the floor return noutput_items; @@ -254,7 +255,6 @@ gr_wavfile_sink::do_update() return; } - gruel::scoped_lock guard(d_mutex); // hold mutex for duration of this block if (d_fp) { close_wav(); } diff --git a/gnuradio-core/src/lib/io/gr_wavfile_sink.h b/gnuradio-core/src/lib/io/gr_wavfile_sink.h index 5fd3eaadc..6a6b7ebf0 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_sink.h +++ b/gnuradio-core/src/lib/io/gr_wavfile_sink.h @@ -86,6 +86,13 @@ private: short convert_to_short(float sample); /*! + * \brief If any file changes have occurred, update now. This is called + * internally by work() and thus doesn't usually need to be called by + * hand. + */ + void do_update(); + + /*! * \brief Writes information to the WAV header which is not available * a-priori (chunk size etc.) and closes the file. Not thread-safe and * assumes d_fp is a valid file pointer, should thus only be called by @@ -108,13 +115,6 @@ public: void close(); /*! - * \brief If any file changes have occurred, update now. This is called - * internally by work() and thus doesn't usually need to be called by - * hand. - */ - void do_update(); - - /*! * \brief Set the sample rate. This will not affect the WAV file * currently opened. Any following open() calls will use this new * sample rate. |