summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PhaseReference.cpp7
-rw-r--r--src/PhaseReference.h4
2 files changed, 5 insertions, 6 deletions
diff --git a/src/PhaseReference.cpp b/src/PhaseReference.cpp
index 208a814..4e4e51a 100644
--- a/src/PhaseReference.cpp
+++ b/src/PhaseReference.cpp
@@ -71,7 +71,7 @@ PhaseReference::PhaseReference(unsigned int dabmode) :
throw std::runtime_error(
"PhaseReference::PhaseReference DAB mode not valid!");
}
- d_dataIn = new complexf[d_num];
+ d_dataIn.resize(d_num);
fillData();
myOutputFormat.size(d_carriers * sizeof(complexf));
@@ -81,8 +81,6 @@ PhaseReference::PhaseReference(unsigned int dabmode) :
PhaseReference::~PhaseReference()
{
PDEBUG("PhaseReference::~PhaseReference() @ %p\n", this);
-
- delete[] d_dataIn;
}
@@ -162,7 +160,8 @@ int PhaseReference::process(Buffer* const dataIn, Buffer* dataOut)
"PhaseReference::process input size not valid!");
}
- dataOut->setData(d_dataIn, d_carriers * sizeof(complexf));
+ dataOut->setData(&d_dataIn[0], d_carriers * sizeof(complexf));
return 1;
}
+
diff --git a/src/PhaseReference.h b/src/PhaseReference.h
index 9ba7233..b4eec82 100644
--- a/src/PhaseReference.h
+++ b/src/PhaseReference.h
@@ -26,11 +26,11 @@
# include <config.h>
#endif
-
#include "ModCodec.h"
#include <sys/types.h>
#include <complex>
+#include <vector>
class PhaseReference : public ModCodec
@@ -50,7 +50,7 @@ protected:
size_t d_carriers;
size_t d_num;
const static unsigned char d_h[4][32];
- std::complex<float>* d_dataIn;
+ std::vector<std::complex<float> > d_dataIn;
void fillData();
};