diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-08-02 13:54:09 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-08-02 13:54:09 +0100 |
| commit | 4dd22fc54d31abf64b7e6f13071904d34ab7636a (patch) | |
| tree | 0d70e6a3e6e3427a9f200267eea77f60326b7fa6 /src | |
| parent | c7e599ad97c7d1965cf58451b724260a16bad0fd (diff) | |
Use FAB subtitler's rather odd DFC -> frame rate mapping.
Diffstat (limited to 'src')
| -rw-r--r-- | src/stl_binary_reader.cc | 20 | ||||
| -rw-r--r-- | src/stl_binary_writer.cc | 3 | ||||
| -rw-r--r-- | src/wscript | 1 |
3 files changed, 8 insertions, 16 deletions
diff --git a/src/stl_binary_reader.cc b/src/stl_binary_reader.cc index c8eff45..dd0020f 100644 --- a/src/stl_binary_reader.cc +++ b/src/stl_binary_reader.cc @@ -17,13 +17,14 @@ */ -#include <boost/lexical_cast.hpp> -#include <boost/algorithm/string.hpp> -#include <boost/locale.hpp> #include "stl_binary_reader.h" #include "exceptions.h" #include "iso6937.h" +#include "stl_util.h" #include "compose.hpp" +#include <boost/lexical_cast.hpp> +#include <boost/algorithm/string.hpp> +#include <boost/locale.hpp> using std::map; using std::vector; @@ -45,18 +46,7 @@ STLBinaryReader::STLBinaryReader (istream& in) } code_page_number = atoi (get_string (0, 3).c_str ()); - - string const dfc = get_string (3, 8); - if (dfc == "STL24.01") { - frame_rate = 24; - } else if (dfc == "STL25.01") { - frame_rate = 25; - } else if (dfc == "STL30.01") { - frame_rate = 30; - } else { - throw STLError (String::compose ("Unknown disk format code %1 in binary STL file", dfc)); - } - + frame_rate = stl_dfc_to_frame_rate (get_string (3, 8)); display_standard = _tables.display_standard_file_to_enum (get_string (11, 1)); language_group = _tables.language_group_file_to_enum (get_string (12, 2)); language = _tables.language_file_to_enum (get_string (14, 2)); diff --git a/src/stl_binary_writer.cc b/src/stl_binary_writer.cc index cb6c71a..9b98b84 100644 --- a/src/stl_binary_writer.cc +++ b/src/stl_binary_writer.cc @@ -20,6 +20,7 @@ #include "stl_binary_writer.h" #include "subtitle.h" #include "iso6937.h" +#include "stl_util.h" #include "compose.hpp" #include <boost/locale.hpp> #include <list> @@ -155,7 +156,7 @@ sub::write_stl_binary ( /* Code page: 850 */ put_string (buffer + 0, "850"); /* Disk format code */ - put_string (buffer + 3, String::compose ("STL%1.01", rint (frames_per_second))); + put_string (buffer + 3, stl_frame_rate_to_dfc (frames_per_second)); /* Display standard code: open subtitling */ put_string (buffer + 11, "0"); /* Character code table: Latin (ISO 6937) */ diff --git a/src/wscript b/src/wscript index 5298ad7..ef5c787 100644 --- a/src/wscript +++ b/src/wscript @@ -26,6 +26,7 @@ def build(bld): stl_binary_tables.cc stl_binary_writer.cc stl_text_reader.cc + stl_util.cc time_pair.cc subtitle.cc vertical_reference.cc |
