diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-01-17 00:06:39 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-01-17 00:06:39 +0000 |
| commit | 5b7a14812684e9f4c6071deae6853bf407171b1e (patch) | |
| tree | e4a23d7f43c06e18186f444a1d98c63f1583f4af /src/reader_factory.cc | |
| parent | eab8e1ea7a93e6136672741dead30cc284bd47c4 (diff) | |
Missing .srt handler in reader_factory.
Diffstat (limited to 'src/reader_factory.cc')
| -rw-r--r-- | src/reader_factory.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/reader_factory.cc b/src/reader_factory.cc index 5d38e4e..759abff 100644 --- a/src/reader_factory.cc +++ b/src/reader_factory.cc @@ -21,6 +21,8 @@ #include "stl_binary_reader.h" #include "stl_text_reader.h" #include "dcp_reader.h" +#include "subrip_reader.h" +#include "sub_assert.h" #include <libxml++/libxml++.h> #include <boost/algorithm/string.hpp> #include <fstream> @@ -59,5 +61,13 @@ sub::reader_factory (boost::filesystem::path file_name) } } + if (ext == ".srt") { + FILE* f = fopen (file_name.string().c_str(), "r"); + SUB_ASSERT (f); + shared_ptr<Reader> r (new SubripReader(f)); + fclose (f); + return r; + } + return shared_ptr<Reader> (); } |
