summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-06-04 11:21:54 +0100
committerCarl Hetherington <cth@carlh.net>2014-06-04 11:21:54 +0100
commite409a8b24d78684246e6dbf7092e1e1ac75da8ed (patch)
tree92db1cfe091c16026c2f1500b95965f55a92e5f8 /src
parentdf5e7ee155351ecd6e7ef52b1764149b5fcb258a (diff)
Various small bug fixes.
Diffstat (limited to 'src')
-rw-r--r--src/stl_binary_reader.cc2
-rw-r--r--src/stl_binary_writer.cc10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/stl_binary_reader.cc b/src/stl_binary_reader.cc
index d0fc266..022ed29 100644
--- a/src/stl_binary_reader.cc
+++ b/src/stl_binary_reader.cc
@@ -66,7 +66,7 @@ STLBinaryReader::STLBinaryReader (istream& in)
translated_episode_title = get_string (112, 32);
translator_name = get_string (144, 32);
translator_contact_details = get_string (176, 32);
- subtitle_list_reference_code = get_string (208, 32);
+ subtitle_list_reference_code = get_string (208, 16);
creation_date = get_string (224, 6);
revision_date = get_string (230, 6);
revision_number = get_string (236, 2);
diff --git a/src/stl_binary_writer.cc b/src/stl_binary_writer.cc
index c8dbc76..127bb97 100644
--- a/src/stl_binary_writer.cc
+++ b/src/stl_binary_writer.cc
@@ -102,8 +102,8 @@ sub::write_stl_binary (
assert (translated_episode_title.size() <= 32);
assert (translator_name.size() <= 32);
assert (translator_contact_details.size() <= 32);
- assert (creation_date.size() == 6);
- assert (revision_date.size() == 6);
+ assert (creation_date.size() == 8);
+ assert (revision_date.size() == 8);
assert (revision_number <= 99);
assert (country_of_origin.size() == 3);
assert (publisher.size() <= 32);
@@ -124,8 +124,8 @@ sub::write_stl_binary (
set<int> check_rows;
for (list<Subtitle>::const_iterator i = subtitles.begin(); i != subtitles.end(); ++i) {
- int t = 0;
for (list<Line>::const_iterator j = i->lines.begin(); j != i->lines.end(); ++j) {
+ int t = 0;
for (list<Block>::const_iterator k = j->blocks.begin(); k != j->blocks.end(); ++k) {
t += k->text.size ();
}
@@ -178,9 +178,9 @@ sub::write_stl_binary (
/* Total number of subtitle groups */
put_string (buffer + 248, "000");
/* Maximum number of displayable characters in any text row */
- put_int_as_string (buffer + 251, 2, longest);
+ put_int_as_string (buffer + 251, longest, 2);
/* Maximum number of displayable rows */
- put_int_as_string (buffer + 253, 2, rows);
+ put_int_as_string (buffer + 253, rows, 2);
/* Time code status */
put_string (buffer + 255, "1");
/* Start-of-programme time code */