projects
/
libsub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eab8e1e
)
Missing .srt handler in reader_factory.
author
Carl Hetherington
<cth@carlh.net>
Thu, 17 Jan 2019 00:06:39 +0000
(
00:06
+0000)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 17 Jan 2019 00:06:39 +0000
(
00:06
+0000)
src/reader_factory.cc
patch
|
blob
|
history
diff --git
a/src/reader_factory.cc
b/src/reader_factory.cc
index 5d38e4e9ec5a57365eed9c564bb89f59a8e1482e..759abff53ca898befc44523a2b6747ffbb689e51 100644
(file)
--- 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> ();
}