diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-19 21:29:55 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-19 21:29:55 +0100 |
commit | 6c482c8f1fdd74f6e7a8a9481b9f2211c559ebad (patch) | |
tree | 12378c91fcfddc1974abf91a58662a6a4b70ed89 /src/DabMux.cpp | |
parent | 72420013928a2d00855ed8ae9c42ac6e229a0b87 (diff) | |
download | dabmux-6c482c8f1fdd74f6e7a8a9481b9f2211c559ebad.tar.gz dabmux-6c482c8f1fdd74f6e7a8a9481b9f2211c559ebad.tar.bz2 dabmux-6c482c8f1fdd74f6e7a8a9481b9f2211c559ebad.zip |
Add wrapper class, and use it for all inputs
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r-- | src/DabMux.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp index f3edd39..2e6e1a6 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -531,17 +531,14 @@ int main(int argc, char *argv[]) (*subchannel)->startAddress = (*(subchannel - 1))->startAddress + getSizeCu(*(subchannel - 1)); } - if ((*subchannel)->operations.open((*subchannel)->data, - (*subchannel)->inputName) == -1) { + if ((*subchannel)->input->open((*subchannel)->inputName) == -1) { perror((*subchannel)->inputName); returnCode = -1; goto EXIT; } // TODO Check errors - int result = (*subchannel)->operations.setBitrate( - &(*subchannel)->operations, (*subchannel)->data, - (*subchannel)->bitrate); + result = (*subchannel)->input->setBitrate( (*subchannel)->bitrate); if (result <= 0) { etiLog.log(error, "can't set bitrate for source %s\n", (*subchannel)->inputName); @@ -1718,15 +1715,8 @@ int main(int argc, char *argv[]) subchannel != ensemble->subchannels.end(); ++subchannel) { int sizeSubchannel = getSizeByte(*subchannel); - if ((*subchannel)->operations.lock != NULL) { - (*subchannel)->operations.lock((*subchannel)->data); - } - result = (*subchannel)->operations.readFrame( - &(*subchannel)->operations, - (*subchannel)->data, &etiFrame[index], sizeSubchannel); - if ((*subchannel)->operations.unlock != NULL) { - (*subchannel)->operations.unlock((*subchannel)->data); - } + result = (*subchannel)->input->readFrame( + &etiFrame[index], sizeSubchannel); if (result < 0) { etiLog.log(info, "Subchannel %d read failed at ETI frame number: %i\n", (*subchannel)->id, currentFrame); } @@ -1823,8 +1813,8 @@ EXIT: for (subchannel = ensemble->subchannels.begin(); subchannel != ensemble->subchannels.end(); ++subchannel) { - (*subchannel)->operations.close((*subchannel)->data); - (*subchannel)->operations.clean(&(*subchannel)->data); + (*subchannel)->input->close(); + delete (*subchannel)->input; } for (output = outputs.begin() ; output != outputs.end(); ++output) { if ((*output)->output) { |