summaryrefslogtreecommitdiff
path: root/src/lib/subtitle_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-26 22:02:00 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-26 22:02:00 +0100
commitc8ff422a42eac30517a7acde57ab84e55449f4e4 (patch)
tree6715a334126cca5558fb6158f0e9082cdb0afb5b /src/lib/subtitle_decoder.cc
parentaddd3f846ed924710d7a416eedcda87653b75968 (diff)
Fix missing subtitles in some cases.
We were passing subtitles back from decoders to SubtitleDecoder using dcp::SubtitleStrings and relying on their storage of time to know when the subtitles were. These times are quantised (by the use of dcp::SubtitleString) and then compared with unquantised times (kept as ContentTime) in the main checking loop in SubtitleDecoder::get(). Fix this by storing periods as ContentTimePeriod as well as in the dcp::SubtitleStrings.
Diffstat (limited to 'src/lib/subtitle_decoder.cc')
-rw-r--r--src/lib/subtitle_decoder.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc
index dd2558505..d20196a63 100644
--- a/src/lib/subtitle_decoder.cc
+++ b/src/lib/subtitle_decoder.cc
@@ -17,9 +17,10 @@
*/
-#include <boost/shared_ptr.hpp>
#include "subtitle_decoder.h"
#include "subtitle_content.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/foreach.hpp>
using std::list;
using std::cout;
@@ -46,9 +47,9 @@ SubtitleDecoder::image_subtitle (ContentTimePeriod period, shared_ptr<Image> ima
}
void
-SubtitleDecoder::text_subtitle (list<dcp::SubtitleString> s)
+SubtitleDecoder::text_subtitle (ContentTimePeriod period, list<dcp::SubtitleString> s)
{
- _decoded_text_subtitles.push_back (ContentTextSubtitle (s));
+ _decoded_text_subtitles.push_back (ContentTextSubtitle (period, s));
}
/** @param sp Full periods of subtitles that are showing or starting during the specified period */