diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-07-21 15:48:33 +0200 | 
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-07-21 15:48:33 +0200 | 
| commit | 33706e0aea432bafe6b2f49e248192b595761f82 (patch) | |
| tree | d05bd93f23737e54049e7a41c69a07a661c30897 /src/odr-sourcecompanion.cpp | |
| parent | ee30f976094c15efb7928d9fabebd4ece7435f4b (diff) | |
| download | ODR-SourceCompanion-33706e0aea432bafe6b2f49e248192b595761f82.tar.gz ODR-SourceCompanion-33706e0aea432bafe6b2f49e248192b595761f82.tar.bz2 ODR-SourceCompanion-33706e0aea432bafe6b2f49e248192b595761f82.zip | |
Add --version option
Diffstat (limited to 'src/odr-sourcecompanion.cpp')
| -rw-r--r-- | src/odr-sourcecompanion.cpp | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/src/odr-sourcecompanion.cpp b/src/odr-sourcecompanion.cpp index 0ec316d..04561bf 100644 --- a/src/odr-sourcecompanion.cpp +++ b/src/odr-sourcecompanion.cpp @@ -79,6 +79,7 @@ void usage(const char* name) {      "         --timeout=ms                         Maximum frame waiting time, in milliseconds (def=2000)\n"        "         --pad-port=port                      Port opened for PAD Frame requests (def=0 not opened)\n"      "         --jitter-size=nbFrames               Jitter buffer size, in 24ms frames (def=40)\n" +    "         --version                            Print version information and quit\n"      "   Encoder parameters:\n"      "     -b, --bitrate={ 8, 16, ..., 192 }    Output bitrate in kbps. Must be a multiple of 8.\n"      "     -c, --channels={ 1, 2 }              Nb of input channels (default: 2).\n" @@ -115,6 +116,18 @@ void usage(const char* name) {  int main(int argc, char *argv[])  { +    // Version handling is done very early to ensure nothing else but the version gets printed out +    if (argc == 2 and strcmp(argv[1], "--version") == 0) { +        fprintf(stdout, "%s\n", +#if defined(GITVERSION) +                GITVERSION +#else +                PACKAGE_VERSION +#endif +               ); +        return 0; +    } +      std::string avt_input_uri = "";      std::string avt_output_uri = "";      int32_t avt_timeout = 2000; | 
