From dc959aa6b105056cafc9e6f98b84c8abda309ca8 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 12 Oct 2020 09:46:31 +0200 Subject: Set default pad length to 6 and add warning if no PAD enabled --- src/odr-audioenc.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp index 8cc8b9e..f6b8b94 100644 --- a/src/odr-audioenc.cpp +++ b/src/odr-audioenc.cpp @@ -469,7 +469,7 @@ public: /* For MOT Slideshow and DLS insertion */ string pad_ident = ""; PadInterface pad_intf; - int padlen = 0; + int padlen = 6; /* Encoder status, see the above STATUS macros */ int status = 0; @@ -635,10 +635,18 @@ int AudioEnc::run() edi_output.set_odr_version_tag(ss.str()); } + if (pad_ident.empty()) { + // Override both default value and user-configured value if no ident given + padlen = 0; + } + if (padlen != 0 and not pad_ident.empty()) { pad_intf.open(pad_ident); fprintf(stderr, "PAD socket opened\n"); } + else { + fprintf(stderr, "PAD disabled because neither PAD length nor PAD identifier given\n"); + } vec_u8 input_buf; -- cgit v1.2.3