From fadcfcf48ea29d2f9031de840da3c730f0a3e7a6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 8 Feb 2019 21:59:31 +0000 Subject: [PATCH] Don't offer to make closed captions from subs in FFmpeg files (related to #1393). --- src/wx/text_panel.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 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 (); -- 2.30.2