diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-14 17:39:32 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-20 11:20:25 +0000 |
| commit | 3f630fb8334238ab8a58fbe1a0f513ae2c00de80 (patch) | |
| tree | 4b773b91029d6374bfd4f2194053d3e249d597cd /src/stl_binary_reader.cc | |
| parent | 49cafda01b3e07c47e3b20dd5ee91e1426446aea (diff) | |
Simplify time representation; better in-tree DCP subtitle parser.
Diffstat (limited to 'src/stl_binary_reader.cc')
| -rw-r--r-- | src/stl_binary_reader.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stl_binary_reader.cc b/src/stl_binary_reader.cc index 2246a01..59cb92b 100644 --- a/src/stl_binary_reader.cc +++ b/src/stl_binary_reader.cc @@ -95,8 +95,8 @@ STLBinaryReader::STLBinaryReader (istream& in) for (size_t i = 0; i < lines.size(); ++i) { RawSubtitle sub; - sub.from.set_frame (get_timecode (5)); - sub.to.set_frame (get_timecode (9)); + sub.from = get_timecode (5); + sub.to = get_timecode (9); sub.vertical_position.line = get_int (13, 1) + i; sub.vertical_position.lines = maximum_rows; sub.vertical_position.reference = TOP_OF_SCREEN; @@ -174,10 +174,10 @@ STLBinaryReader::get_int (int offset, int length) const return v; } -FrameTime +Time STLBinaryReader::get_timecode (int offset) const { - return FrameTime (_buffer[offset], _buffer[offset + 1], _buffer[offset + 2], _buffer[offset + 3]); + return Time::from_hmsf (_buffer[offset], _buffer[offset + 1], _buffer[offset + 2], _buffer[offset + 3], Rational (frame_rate, 1)); } map<string, string> |
