source/sink: initialize sample rate cache variable

Thanks to Jiří Pinkava for bringing this up.
This commit is contained in:
Dimitri Stolnikov 2013-10-03 14:25:28 +02:00
parent d335280b2e
commit e303948ffb
4 changed files with 6 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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