summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-03-27 11:17:22 +0000
committerCarl Hetherington <cth@carlh.net>2019-03-27 11:17:22 +0000
commit33aa4abdc8702205005596618274d727ebca4424 (patch)
tree4e8b0ea14665714204538c74c74b2ec5b630f99c /src
parent9153a8a53ada73b4b016e7bb6faf1c2ed99f011b (diff)
Hack to avoid empty tracks appearing in the DCP Track control.
Diffstat (limited to 'src')
-rw-r--r--src/lib/film.cc2
-rw-r--r--src/wx/text_panel.cc7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index f61d5106f..9be048b65 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1662,7 +1662,7 @@ Film::closed_caption_tracks () const
list<DCPTextTrack> tt;
BOOST_FOREACH (shared_ptr<Content> i, content()) {
BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
- /* XXX: Empty DCPTextTrack ends up being a magic value here */
+ /* XXX: Empty DCPTextTrack ends up being a magic value here - the "unknown" or "not specified" track */
DCPTextTrack dtt = j->dcp_track().get_value_or(DCPTextTrack());
if (j->type() == TEXT_CLOSED_CAPTION && find(tt.begin(), tt.end(), dtt) == tt.end()) {
tt.push_back (dtt);
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index b5adf551e..a9f2f91f1 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -255,7 +255,12 @@ TextPanel::update_dcp_tracks ()
{
_dcp_track->Clear ();
BOOST_FOREACH (DCPTextTrack i, _parent->film()->closed_caption_tracks()) {
- _dcp_track->Append (std_to_wx(i.summary()));
+ /* XXX: don't display the "magic" track which has empty name and language;
+ this is a nasty hack (see also Film::closed_caption_tracks)
+ */
+ if (!i.name.empty() || !i.language.empty()) {
+ _dcp_track->Append (std_to_wx(i.summary()));
+ }
}
if (_parent->film()->closed_caption_tracks().size() < 6) {