diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-16 04:00:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-16 04:00:16 +0100 |
| commit | 04d7ca2e5470924d79ddcff0496ebef9b5cec8b7 (patch) | |
| tree | 2202380eb85cd1576a9aae71a5e982fa3af01afe /src | |
| parent | ae844ac43c70baee0768d4b6bf9725359079fb62 (diff) | |
Fix int/float confusion.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/server.cc | 2 | ||||
| -rw-r--r-- | src/lib/util.cc | 7 | ||||
| -rw-r--r-- | src/lib/util.h | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc index e8a9804ed..10f64b482 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -90,7 +90,7 @@ Server::process (shared_ptr<Socket> socket) Size out_size (get_required_int (kv, "output_width"), get_required_int (kv, "output_height")); int padding = get_required_int (kv, "padding"); int subtitle_offset = get_required_int (kv, "subtitle_offset"); - int subtitle_scale = get_required_int (kv, "subtitle_scale"); + float subtitle_scale = get_required_float (kv, "subtitle_scale"); string scaler_id = get_required_string (kv, "scaler"); int frame = get_required_int (kv, "frame"); int frames_per_second = get_required_int (kv, "frames_per_second"); diff --git a/src/lib/util.cc b/src/lib/util.cc index c2b24944d..9a0a8be82 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -675,6 +675,13 @@ get_required_int (multimap<string, string> const & kv, string k) return lexical_cast<int> (v); } +float +get_required_float (multimap<string, string> const & kv, string k) +{ + string const v = get_required_string (kv, k); + return lexical_cast<float> (v); +} + string get_optional_string (multimap<string, string> const & kv, string k) { diff --git a/src/lib/util.h b/src/lib/util.h index 5f2e9a7fa..da7e73f20 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -160,6 +160,7 @@ extern std::string colour_lut_index_to_name (int index); extern int round_up (int, int); extern std::multimap<std::string, std::string> read_key_value (std::istream& s); extern int get_required_int (std::multimap<std::string, std::string> const & kv, std::string k); +extern float get_required_float (std::multimap<std::string, std::string> const & kv, std::string k); extern std::string get_required_string (std::multimap<std::string, std::string> const & kv, std::string k); extern int get_optional_int (std::multimap<std::string, std::string> const & kv, std::string k); extern std::string get_optional_string (std::multimap<std::string, std::string> const & kv, std::string k); @@ -169,7 +170,7 @@ extern std::string get_optional_string (std::multimap<std::string, std::string> * that are useful for DVD-o-matic. * * This class wraps some things that I could not work out how to do with boost; - * most notably, sync read/write calls with timeouts, and the ability to peak into + * most notably, sync read/write calls with timeouts, and the ability to peek into * data being read. */ class Socket |
