summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-29 15:07:17 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-29 15:07:17 +0100
commit318a778b1b5c98b79b202dc953ff2ac131371a1b (patch)
tree52d05d9927c22842c5047a625e07eb9c92f87cdb
parent3802ba3df2ac27d4fabdcbd61b9ed84f6adf5627 (diff)
parentb289602176a4943233cffb75e8ccac379112420a (diff)
Fix merge.
-rw-r--r--ChangeLog10
-rw-r--r--TO_PORT1
-rw-r--r--debian/changelog5
-rw-r--r--icons/dcpomatic.icnsbin334930 -> 334232 bytes
-rw-r--r--icons/keys.pngbin1544 -> 1842 bytes
-rw-r--r--src/lib/content_subtitle.cc31
-rw-r--r--src/lib/content_subtitle.h33
-rw-r--r--src/lib/dcp_subtitle_decoder.cc16
-rw-r--r--src/lib/dcp_subtitle_decoder.h1
-rw-r--r--src/lib/ffmpeg_content.cc3
-rw-r--r--src/lib/playlist.cc5
-rw-r--r--src/lib/subrip_decoder.cc19
-rw-r--r--src/lib/subrip_decoder.h1
-rw-r--r--src/lib/subtitle_content.cc7
-rw-r--r--src/lib/subtitle_decoder.cc7
-rw-r--r--src/lib/subtitle_decoder.h2
-rw-r--r--src/lib/wscript3
-rw-r--r--src/wx/about_dialog.cc1
-rw-r--r--src/wx/subtitle_panel.cc2
-rw-r--r--test/srt_subtitle_test.cc46
-rw-r--r--wscript2
21 files changed, 124 insertions, 71 deletions
diff --git a/ChangeLog b/ChangeLog
index ac0cbdf4b..c0b3d0583 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,16 @@
* Disallow impossible burn settings by manipulating
the controls in the subtitle panel (#625).
+2015-06-26 Carl Hetherington <cth@carlh.net>
+
+ * Version 2.1.11 released.
+
+2015-06-26 Carl Hetherington <cth@carlh.net>
+
+ * Fix missing subtitles in some cases.
+
+ * Fix no-rebuild of DCP after subtitle burn is turned off/on.
+
2015-06-25 Carl Hetherington <cth@carlh.net>
* Version 2.1.10 released.
diff --git a/TO_PORT b/TO_PORT
deleted file mode 100644
index 6a40df8a8..000000000
--- a/TO_PORT
+++ /dev/null
@@ -1 +0,0 @@
-26d4079c0a1eb010b0909e8f046f04381408b6f3
diff --git a/debian/changelog b/debian/changelog
index 8194dd1f0..7bdab3429 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-dcpomatic (2.1.10-1) UNRELEASED; urgency=low
+dcpomatic (2.1.11-1) UNRELEASED; urgency=low
* New upstream release.
* New upstream release.
@@ -241,8 +241,9 @@ dcpomatic (2.1.10-1) UNRELEASED; urgency=low
* New upstream release.
* New upstream release.
* New upstream release.
+ * New upstream release.
- -- Carl Hetherington <carl@d1stkfactory> Thu, 25 Jun 2015 12:00:12 +0100
+ -- Carl Hetherington <carl@d1stkfactory> Fri, 26 Jun 2015 22:17:40 +0100
dcpomatic (0.87-1) UNRELEASED; urgency=low
diff --git a/icons/dcpomatic.icns b/icons/dcpomatic.icns
index ef1208ea8..a90244fc4 100644
--- a/icons/dcpomatic.icns
+++ b/icons/dcpomatic.icns
Binary files differ
diff --git a/icons/keys.png b/icons/keys.png
index 28701ee49..e76acbeff 100644
--- a/icons/keys.png
+++ b/icons/keys.png
Binary files differ
diff --git a/src/lib/content_subtitle.cc b/src/lib/content_subtitle.cc
deleted file mode 100644
index 4eed8b4b2..000000000
--- a/src/lib/content_subtitle.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "content_subtitle.h"
-
-ContentTimePeriod
-ContentTextSubtitle::period () const
-{
- /* XXX: assuming we have some subs and they are all at the same time */
- DCPOMATIC_ASSERT (!subs.empty ());
- return ContentTimePeriod (
- ContentTime::from_seconds (subs.front().in().as_seconds()),
- ContentTime::from_seconds (subs.front().out().as_seconds())
- );
-}
diff --git a/src/lib/content_subtitle.h b/src/lib/content_subtitle.h
index ef904a980..3c0ce523e 100644
--- a/src/lib/content_subtitle.h
+++ b/src/lib/content_subtitle.h
@@ -31,37 +31,42 @@ class Image;
class ContentSubtitle
{
public:
- virtual ContentTimePeriod period () const = 0;
+ ContentSubtitle (ContentTimePeriod p)
+ : _period (p)
+ {}
+
+ ContentTimePeriod period () const {
+ return _period;
+ }
+
+private:
+ ContentTimePeriod _period;
};
class ContentImageSubtitle : public ContentSubtitle
{
public:
ContentImageSubtitle (ContentTimePeriod p, boost::shared_ptr<Image> im, dcpomatic::Rect<double> r)
- : sub (im, r)
- , _period (p)
+ : ContentSubtitle (p)
+ , sub (im, r)
{}
- ContentTimePeriod period () const {
- return _period;
- }
-
/* Our subtitle, with its rectangle unmodified by any offsets or scales that the content specifies */
ImageSubtitle sub;
-
-private:
- ContentTimePeriod _period;
};
+/** A text subtitle. We store the time period separately (as well as in the dcp::SubtitleStrings)
+ * as the dcp::SubtitleString timings are sometimes quite heavily quantised and this causes problems
+ * when we want to compare the quantised periods to the unquantised ones.
+ */
class ContentTextSubtitle : public ContentSubtitle
{
public:
- ContentTextSubtitle (std::list<dcp::SubtitleString> s)
- : subs (s)
+ ContentTextSubtitle (ContentTimePeriod p, std::list<dcp::SubtitleString> s)
+ : ContentSubtitle (p)
+ , subs (s)
{}
- ContentTimePeriod period () const;
-
std::list<dcp::SubtitleString> subs;
};
diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc
index 3c7bffdda..bb2537fc4 100644
--- a/src/lib/dcp_subtitle_decoder.cc
+++ b/src/lib/dcp_subtitle_decoder.cc
@@ -54,7 +54,7 @@ DCPSubtitleDecoder::pass ()
list<dcp::SubtitleString> s;
s.push_back (*_next);
- text_subtitle (s);
+ text_subtitle (content_time_period (*_next), s);
++_next;
return false;
@@ -74,11 +74,7 @@ DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) c
list<ContentTimePeriod> d;
for (list<dcp::SubtitleString>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
- ContentTimePeriod period (
- ContentTime::from_seconds (i->in().as_seconds ()),
- ContentTime::from_seconds (i->out().as_seconds ())
- );
-
+ ContentTimePeriod period = content_time_period (*i);
if ((starting && p.contains (period.from)) || (!starting && p.overlaps (period))) {
d.push_back (period);
}
@@ -87,3 +83,11 @@ DCPSubtitleDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) c
return d;
}
+ContentTimePeriod
+DCPSubtitleDecoder::content_time_period (dcp::SubtitleString s) const
+{
+ return ContentTimePeriod (
+ ContentTime::from_seconds (s.in().as_seconds ()),
+ ContentTime::from_seconds (s.out().as_seconds ())
+ );
+}
diff --git a/src/lib/dcp_subtitle_decoder.h b/src/lib/dcp_subtitle_decoder.h
index a27d6b2db..fb2213fa2 100644
--- a/src/lib/dcp_subtitle_decoder.h
+++ b/src/lib/dcp_subtitle_decoder.h
@@ -34,6 +34,7 @@ protected:
private:
std::list<ContentTimePeriod> image_subtitles_during (ContentTimePeriod, bool starting) const;
std::list<ContentTimePeriod> text_subtitles_during (ContentTimePeriod, bool starting) const;
+ ContentTimePeriod content_time_period (dcp::SubtitleString s) const;
std::list<dcp::SubtitleString> _subtitles;
std::list<dcp::SubtitleString>::const_iterator _next;
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index ba0b4cc52..9d3a79e81 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -292,7 +292,8 @@ FFmpegContent::identifier () const
{
SafeStringStream s;
- s << VideoContent::identifier();
+ s << VideoContent::identifier() << "_"
+ << SubtitleContent::identifier();
boost::mutex::scoped_lock lm (_mutex);
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index c5e026699..a0afae0ad 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -113,8 +113,11 @@ Playlist::video_identifier () const
for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
+ shared_ptr<const SubtitleContent> sc = dynamic_pointer_cast<const SubtitleContent> (*i);
if (vc) {
t += vc->identifier ();
+ } else if (sc && sc->burn_subtitles ()) {
+ t += sc->identifier ();
}
}
diff --git a/src/lib/subrip_decoder.cc b/src/lib/subrip_decoder.cc
index c2bd4f3e0..6542c1a8e 100644
--- a/src/lib/subrip_decoder.cc
+++ b/src/lib/subrip_decoder.cc
@@ -82,7 +82,8 @@ SubRipDecoder::pass ()
}
}
- text_subtitle (out);
+ text_subtitle (content_time_period (_subtitles[_next]), out);
+
++_next;
return false;
}
@@ -101,12 +102,7 @@ SubRipDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const
list<ContentTimePeriod> d;
for (vector<sub::Subtitle>::const_iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
-
- ContentTimePeriod t (
- ContentTime::from_seconds (i->from.all_as_seconds()),
- ContentTime::from_seconds (i->to.all_as_seconds())
- );
-
+ ContentTimePeriod t = content_time_period (*i);
if ((starting && p.contains (t.from)) || (!starting && p.overlaps (t))) {
d.push_back (t);
}
@@ -114,3 +110,12 @@ SubRipDecoder::text_subtitles_during (ContentTimePeriod p, bool starting) const
return d;
}
+
+ContentTimePeriod
+SubRipDecoder::content_time_period (sub::Subtitle s) const
+{
+ return ContentTimePeriod (
+ ContentTime::from_seconds (s.from.all_as_seconds()),
+ ContentTime::from_seconds (s.to.all_as_seconds())
+ );
+}
diff --git a/src/lib/subrip_decoder.h b/src/lib/subrip_decoder.h
index 38ccca0a3..db8374c5c 100644
--- a/src/lib/subrip_decoder.h
+++ b/src/lib/subrip_decoder.h
@@ -37,6 +37,7 @@ protected:
private:
std::list<ContentTimePeriod> image_subtitles_during (ContentTimePeriod, bool starting) const;
std::list<ContentTimePeriod> text_subtitles_during (ContentTimePeriod, bool starting) const;
+ ContentTimePeriod content_time_period (sub::Subtitle s) const;
size_t _next;
};
diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc
index a10e23caf..29c610d83 100644
--- a/src/lib/subtitle_content.cc
+++ b/src/lib/subtitle_content.cc
@@ -268,6 +268,13 @@ SubtitleContent::identifier () const
<< "_" << raw_convert<string> (subtitle_x_offset())
<< "_" << raw_convert<string> (subtitle_y_offset());
+ /* XXX: I suppose really _fonts shouldn't be in here, since not all
+ types of subtitle content involve fonts.
+ */
+ BOOST_FOREACH (shared_ptr<Font> f, _fonts) {
+ s << f->file().get_value_or ("Default");
+ }
+
/* The language is for metadata only, and doesn't affect
how this content looks.
*/
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 */
diff --git a/src/lib/subtitle_decoder.h b/src/lib/subtitle_decoder.h
index c958419c7..5f11e27e7 100644
--- a/src/lib/subtitle_decoder.h
+++ b/src/lib/subtitle_decoder.h
@@ -42,7 +42,7 @@ protected:
void seek (ContentTime, bool);
void image_subtitle (ContentTimePeriod period, boost::shared_ptr<Image>, dcpomatic::Rect<double>);
- void text_subtitle (std::list<dcp::SubtitleString>);
+ void text_subtitle (ContentTimePeriod period, std::list<dcp::SubtitleString>);
std::list<ContentImageSubtitle> _decoded_image_subtitles;
std::list<ContentTextSubtitle> _decoded_text_subtitles;
diff --git a/src/lib/wscript b/src/lib/wscript
index 85cbcb7b6..1f870462e 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -36,7 +36,6 @@ sources = """
config.cc
content.cc
content_factory.cc
- content_subtitle.cc
cross.cc
data.cc
dcp_content.cc
@@ -132,7 +131,7 @@ def build(bld):
obj.name = 'libdcpomatic2'
obj.export_includes = ['..']
obj.uselib = """
- AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE
+ AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE
BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2
SNDFILE OPENJPEG POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
CURL ZIP PANGOMM CAIROMM XMLSEC SUB
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc
index 142705a55..85cfc92be 100644
--- a/src/wx/about_dialog.cc
+++ b/src/wx/about_dialog.cc
@@ -227,6 +227,7 @@ AboutDialog::AboutDialog (wxWindow* parent)
tested_by.Add (wxT ("Mauro Ottonello"));
tested_by.Add (wxT ("Peter Puchner"));
tested_by.Add (wxT ("Markus Raab"));
+ tested_by.Add (wxT ("Michael Reckert"));
tested_by.Add (wxT ("Greg Rooke"));
tested_by.Add (wxT ("Elad Saad"));
tested_by.Add (wxT ("Karim Senoucci"));
diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc
index a7774ed20..3d6e5c8c3 100644
--- a/src/wx/subtitle_panel.cc
+++ b/src/wx/subtitle_panel.cc
@@ -51,7 +51,7 @@ SubtitlePanel::SubtitlePanel (ContentPanel* p)
grid->Add (_use);
grid->AddSpacer (0);
- _burn = new wxCheckBox (this, wxID_ANY, _("Burn subtitles"));
+ _burn = new wxCheckBox (this, wxID_ANY, _("Burn subtitles into image"));
grid->Add (_burn);
grid->AddSpacer (0);
diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc
index 161d23d77..1837d816b 100644
--- a/test/srt_subtitle_test.cc
+++ b/test/srt_subtitle_test.cc
@@ -27,7 +27,11 @@
#include "lib/font.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
+#include <boost/algorithm/string.hpp>
+#include <list>
+using std::string;
+using std::list;
using boost::shared_ptr;
/** Make a very short DCP with a single subtitle from .srt with no specified fonts */
@@ -73,3 +77,45 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2)
check_dcp ("test/data/srt_subtitle_test2", film->dir (film->dcp_name ()));
}
+/** Make another DCP with a longer .srt file */
+BOOST_AUTO_TEST_CASE (srt_subtitle_test3)
+{
+ shared_ptr<Film> film = new_test_film ("srt_subtitle_test3");
+
+ film->set_container (Ratio::from_id ("185"));
+ film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
+ film->set_name ("frobozz");
+ film->set_interop (true);
+ shared_ptr<SubRipContent> content (new SubRipContent (film, private_data / "Ankoemmling.srt"));
+ film->examine_and_add_content (content);
+ wait_for_jobs ();
+
+ content->set_use_subtitles (true);
+ content->set_burn_subtitles (false);
+
+ film->make_dcp ();
+ wait_for_jobs ();
+
+ /* Find the subtitle file and check it */
+ for (
+ boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (film->directory() / film->dcp_name (false));
+ i != boost::filesystem::directory_iterator ();
+ ++i) {
+
+ if (boost::filesystem::is_directory (i->path ())) {
+ for (
+ boost::filesystem::directory_iterator j = boost::filesystem::directory_iterator (i->path ());
+ j != boost::filesystem::directory_iterator ();
+ ++j) {
+
+ std::cout << j->path().string() << "\n";
+
+ if (boost::algorithm::starts_with (j->path().leaf().string(), "sub_")) {
+ list<string> ignore;
+ ignore.push_back ("SubtitleID");
+ check_xml (*j, private_data / "Ankoemmling.xml", ignore);
+ }
+ }
+ }
+ }
+}
diff --git a/wscript b/wscript
index af711af05..d10f7782e 100644
--- a/wscript
+++ b/wscript
@@ -26,7 +26,7 @@ import distutils.spawn
from waflib import Logs
APPNAME = 'dcpomatic'
-VERSION = '2.1.10devel'
+VERSION = '2.1.11devel'
def options(opt):
opt.load('compiler_cxx')