From b1cf5b2ee9d6d17a61a16996029931ea1d622abc Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Fri, 17 Apr 2015 23:57:52 +0200 Subject: MOT: use max segment len --- src/mot-encoder.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp index 34adba5..ea1e230 100644 --- a/src/mot-encoder.cpp +++ b/src/mot-encoder.cpp @@ -3,6 +3,8 @@ Copyright (C) 2014 Matthias P. Braendli (http://opendigitalradio.org) + Copyright (C) 2015 Stefan Pöschel (http://opendigitalradio.org) + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or @@ -22,6 +24,7 @@ Authors: Sergio Sagliocco Matthias P. Braendli + Stefan Pöschel */ #include @@ -55,7 +58,7 @@ extern "C" { #define XSTR(x) #x #define STR(x) XSTR(x) -#define MAXSEGLEN 8179 // Bytes +#define MAXSEGLEN 8189 // Bytes (EN 301 234, ch. 5.1.1) #define MAXDLS 128 // chars #define MAXSLIDESIZE 50000 // Bytes @@ -591,7 +594,7 @@ int encodeFile(int output_fd, std::string& fname, int fidx, int padlen, bool raw unsigned char *curseg = NULL; MagickBooleanType err; MSCDG msc; - unsigned char mscblob[8200]; + unsigned char mscblob[9 + MAXSEGLEN + 2]; // headers + segment + CRC unsigned short int mscblobsize; size_t orig_quality; @@ -883,7 +886,7 @@ void packMscDG(unsigned char* b, MSCDG* msc, unsigned short int* bsize) b[9+msc->seglen] = (crc & 0xFF00) >> 8; // HI CRC b[9+msc->seglen+1] = crc & 0x00FF; // LO CRC - *bsize = 9 + msc->seglen + 1 + 1; + *bsize = 9 + msc->seglen + 2; //write(1,b,9+msc->seglen+1+1); } -- cgit v1.2.3