summaryrefslogtreecommitdiff
path: root/src/stl_binary_reader.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-01-23 15:37:13 +0100
committerCarl Hetherington <cth@carlh.net>2020-01-23 20:59:31 +0100
commitba69e87b6d64c6f9ce015bf657a195c070762344 (patch)
treec6ff0d4f2824b60190bebdb451c06c21fb0f4c50 /src/stl_binary_reader.cc
parent407407a253b9d71cf212402e5896000a81dfd318 (diff)
Add hack for binary STL files with high MNR (maximum number of rows) values.
Diffstat (limited to 'src/stl_binary_reader.cc')
-rw-r--r--src/stl_binary_reader.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/stl_binary_reader.cc b/src/stl_binary_reader.cc
index 7c5386b..9a7a150 100644
--- a/src/stl_binary_reader.cc
+++ b/src/stl_binary_reader.cc
@@ -166,6 +166,17 @@ void STLBinaryReader::read (shared_ptr<InputReader> reader)
subtitle_groups = atoi (reader->get_string(248, 3).c_str());
maximum_characters = atoi (reader->get_string(251, 2).c_str());
maximum_rows = atoi (reader->get_string(253, 2).c_str());
+
+ if (maximum_rows == 99) {
+ /* https://tech.ebu.ch/docs/tech/tech3360.pdf says
+ "It is recommended that for files with a large MNR value (e.g. '99') the
+ font size (height) should be defined as ~ 1/15 of the 'Subtitle Safe Area'
+ and a lineHeight of 120% is used to achieve a row height of ~ 1/12 of the height
+ of the 'Subtitle Safe Area'.
+ */
+ maximum_rows = 12;
+ }
+
timecode_status = _tables.timecode_status_file_to_enum (reader->get_string(255, 1));
start_of_programme = reader->get_string(256, 8);
first_in_cue = reader->get_string(264, 8);