aboutsummaryrefslogtreecommitdiffstats
path: root/faad_decoder.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-11-21 07:52:14 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-11-21 07:52:14 +0100
commit8895b894cedbda048bb5d9fdb6591737fd4165ff (patch)
tree035235d15f88241ee0e90c1154431bb4c345824c /faad_decoder.cpp
parent77808453cd8e23b08dd15a997161195d5c482b4f (diff)
downloadetisnoop-8895b894cedbda048bb5d9fdb6591737fd4165ff.tar.gz
etisnoop-8895b894cedbda048bb5d9fdb6591737fd4165ff.tar.bz2
etisnoop-8895b894cedbda048bb5d9fdb6591737fd4165ff.zip
fix segfault, dump dabp
Diffstat (limited to 'faad_decoder.cpp')
-rw-r--r--faad_decoder.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/faad_decoder.cpp b/faad_decoder.cpp
index 21b12fa..17024ca 100644
--- a/faad_decoder.cpp
+++ b/faad_decoder.cpp
@@ -37,9 +37,10 @@ using namespace std;
FaadDecoder::FaadDecoder() :
m_data_len(0),
+ m_fd(NULL),
+ m_aac(NULL),
m_initialised(false)
{
- m_aac = NULL;
}
void FaadDecoder::open(string filename, bool ps_flag, bool aac_channel_mode,
@@ -137,7 +138,7 @@ bool FaadDecoder::decode(vector<vector<uint8_t> > aus)
memcpy(helpBuffer, d_header, 7 * sizeof(uint8_t));
memcpy(&helpBuffer[7],
- &au[0], vh.aac_frame_length * sizeof (uint8_t));
+ &au[0], au.size() * sizeof (uint8_t));
fwrite(helpBuffer, 1, vh.aac_frame_length, m_aac);
@@ -178,11 +179,13 @@ bool FaadDecoder::decode(vector<vector<uint8_t> > aus)
m_channels = hInfo.channels;
size_t samples = hInfo.samples;
+#if 0
printf("bytes consumed %d\n", (int)(hInfo.bytesconsumed));
printf("samplerate = %d, samples = %zu, channels = %d,"
" error = %d, sbr = %d\n", m_sample_rate, samples,
m_channels, hInfo.error, hInfo.sbr);
printf("header = %d\n", hInfo.header_type);
+#endif
if (hInfo.error != 0) {
printf("FAAD Warning: %s\n",