Hack to avoid empty tracks appearing in the DCP Track control.
[dcpomatic.git] / src / wx / text_panel.cc
index b5adf551e787ffb4f383966d380f82cd90e1c69a..a9f2f91f1bb6425a0322dea52df5472e4bd6fdfc 100644 (file)
@@ -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) {