Skip to content

Commit

Permalink
Merge pull request #864 from g-maxime/ffmpeg-plugin-activation
Browse files Browse the repository at this point in the history
Windows GUI: Fix unwanted deactivation of the ffmpeg plugin
  • Loading branch information
JeromeMartinez authored Jun 5, 2024
2 parents bbfebe6 + 5830e02 commit 029a950
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions Source/GUI/VCL/GUI_Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,21 +436,24 @@ void __fastcall TPreferencesF::Advanced_InformTimestampClick(TObject *Sender)
//---------------------------------------------------------------------------
void __fastcall TPreferencesF::Advanced_EnableFfmpegClick(TObject *Sender)
{
if (Advanced_EnableFfmpeg->Checked && Prefs->Config(__T("EnableFfmpeg"), 1) != __T("1"))
if (Advanced_EnableFfmpeg->Checked)
{
#ifndef MEDIAINFOGUI_PLUGIN_NO
Ztring InstallFolder = Application->ExeName.c_str();
InstallFolder = InstallFolder.substr(0, InstallFolder.rfind(__T("\\")) + 1);

if (!File::Exists(InstallFolder+__T("\\Plugin\\FFmpeg\\version.txt"))) //Try to install plugin
if (Prefs->Config(__T("EnableFfmpeg"), 1) != __T("1"))
{
TPluginF* P = new TPluginF(this, PLUGIN_FFMPEG);
if (P->Configure())
P->ShowModal();
delete P;

if (!File::Exists(InstallFolder+__T("\\Plugin\\FFmpeg\\version.txt")))
MessageBox(NULL, __T("An error occured, please download and install the plugin manually from the MediaInfo download page."), __T("Error"), MB_OK);
Ztring InstallFolder = Application->ExeName.c_str();
InstallFolder = InstallFolder.substr(0, InstallFolder.rfind(__T("\\")) + 1);

if (!File::Exists(InstallFolder+__T("\\Plugin\\FFmpeg\\version.txt"))) //Try to install plugin
{
TPluginF* P = new TPluginF(this, PLUGIN_FFMPEG);
if (P->Configure())
P->ShowModal();
delete P;

if (!File::Exists(InstallFolder+__T("\\Plugin\\FFmpeg\\version.txt")))
MessageBox(NULL, __T("An error occured, please download and install the plugin manually from the MediaInfo download page."), __T("Error"), MB_OK);
}
}
#endif
Prefs->Config(__T("EnableFfmpeg"), 1)=__T("1");
Expand Down

0 comments on commit 029a950

Please sign in to comment.