source/sink: initialize sample rate cache variable

Thanks to Jiří Pinkava for bringing this up.
wip-signat
Dimitri Stolnikov 9 years ago
parent d335280b2e
commit e303948ffb
  1. 3
      lib/sink_impl.cc
  2. 1
      lib/sink_impl.h
  3. 3
      lib/source_impl.cc
  4. 1
      lib/source_impl.h

@ -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;

@ -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;

@ -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;

@ -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;

Loading…
Cancel
Save