diff --git a/lib/sink_impl.cc b/lib/sink_impl.cc index 9362ae4..a3fb84d 100644 --- a/lib/sink_impl.cc +++ b/lib/sink_impl.cc @@ -65,7 +65,8 @@ osmosdr::sink::make( const std::string &args ) sink_impl::sink_impl( const std::string &args ) : gr::hier_block2 ("sink_impl", args_to_io_signature(args), - gr::io_signature::make(0, 0, 0)) + gr::io_signature::make(0, 0, 0)), + _sample_rate(NAN) { size_t channel = 0; bool device_specified = false; diff --git a/lib/sink_impl.h b/lib/sink_impl.h index 9cf2843..3b95a19 100644 --- a/lib/sink_impl.h +++ b/lib/sink_impl.h @@ -71,6 +71,7 @@ public: private: std::vector< sink_iface * > _devs; + /* cache to prevent multiple device calls with the same value coming from grc */ double _sample_rate; std::map< size_t, double > _center_freq; std::map< size_t, double > _freq_corr; diff --git a/lib/source_impl.cc b/lib/source_impl.cc index 075bd29..c26004b 100644 --- a/lib/source_impl.cc +++ b/lib/source_impl.cc @@ -91,7 +91,8 @@ osmosdr::source::make( const std::string &args ) source_impl::source_impl( const std::string &args ) : gr::hier_block2 ("source_impl", gr::io_signature::make(0, 0, 0), - args_to_io_signature(args)) + args_to_io_signature(args)), + _sample_rate(NAN) { size_t channel = 0; bool device_specified = false; diff --git a/lib/source_impl.h b/lib/source_impl.h index e33f3d7..42ab021 100644 --- a/lib/source_impl.h +++ b/lib/source_impl.h @@ -78,6 +78,7 @@ public: private: std::vector< source_iface * > _devs; + /* cache to prevent multiple device calls with the same value coming from grc */ double _sample_rate; std::map< size_t, double > _center_freq; std::map< size_t, double > _freq_corr;