summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-02-08 21:59:31 +0000
committerCarl Hetherington <cth@carlh.net>2019-02-08 21:59:31 +0000
commitfadcfcf48ea29d2f9031de840da3c730f0a3e7a6 (patch)
tree0f8ae6eecd9c5139673687a3c420e9b3a50d5290 /src
parenta4bfdcef81635c95968d062a3de0ed3cad196635 (diff)
Don't offer to make closed captions from subs in FFmpeg files (related to #1393).
Diffstat (limited to 'src')
-rw-r--r--src/wx/text_panel.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index 3c5abcefc..9e60b3f00 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -433,6 +433,7 @@ void
TextPanel::setup_sensitivity ()
{
int any_subs = 0;
+ /* we currently assume that FFmpeg subtitles are bitmapped */
int ffmpeg_subs = 0;
ContentList sel = _parent->selected_text ();
BOOST_FOREACH (shared_ptr<Content> i, sel) {
@@ -467,6 +468,26 @@ TextPanel::setup_sensitivity ()
TextType const type = current_type ();
+ /* Set up _type */
+ _type->Clear ();
+ _type->Append (_("open subtitles"));
+ if (ffmpeg_subs == 0) {
+ _type->Append (_("closed captions"));
+ }
+
+ switch (type) {
+ case TEXT_OPEN_SUBTITLE:
+ _type->SetSelection (0);
+ break;
+ case TEXT_CLOSED_CAPTION:
+ if (_type->GetCount() > 1) {
+ _type->SetSelection (1);
+ }
+ break;
+ default:
+ break;
+ }
+
/* Set up sensitivity */
_use->Enable (!reference && any_subs > 0);
bool const use = _use->GetValue ();