diff --git a/aegisub/src/audio_provider_ffmpegsource.cpp b/aegisub/src/audio_provider_ffmpegsource.cpp index 91b074f38..db3884b5a 100644 --- a/aegisub/src/audio_provider_ffmpegsource.cpp +++ b/aegisub/src/audio_provider_ffmpegsource.cpp @@ -46,7 +46,10 @@ /////////// // Constructor FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(Aegisub::String filename) { - FFMS_Init(); + if (FFMS_Init()) { + FFMS_DeInit(); + throw _T("FFmpegSource audio provider: failed to initialize FFMS2"); + } MsgSize = sizeof(FFMSErrMsg); MsgString = _T("FFmpegSource audio provider: "); @@ -181,6 +184,7 @@ FFmpegSourceAudioProvider::~FFmpegSourceAudioProvider() { void FFmpegSourceAudioProvider::Close() { FFMS_DestroyAudioSource(AudioSource); AudioSource = NULL; + FFMS_DeInit(); } diff --git a/aegisub/src/ffmpegsource_common.cpp b/aegisub/src/ffmpegsource_common.cpp index 4853026db..ba5cd0e36 100644 --- a/aegisub/src/ffmpegsource_common.cpp +++ b/aegisub/src/ffmpegsource_common.cpp @@ -84,7 +84,7 @@ FFIndex *FFmpegSourceProvider::DoIndexing(FFIndex *Index, wxString FileNameWX, w Progress.ProgressDialog->SetProgress(0,1); // index all audio tracks - Index = FFMS_MakeIndex(FileNameWX.mb_str(wxConvLocal), Trackmask, FFMSTrackMaskNone, NULL, IgnoreDecodeErrors, FFmpegSourceProvider::UpdateIndexingProgress, &Progress, FFMSErrMsg, MsgSize); + Index = FFMS_MakeIndex(FileNameWX.mb_str(wxConvLocal), Trackmask, FFMSTrackMaskNone, NULL, NULL, IgnoreDecodeErrors, FFmpegSourceProvider::UpdateIndexingProgress, &Progress, FFMSErrMsg, MsgSize); if (!Index) { Progress.ProgressDialog->Destroy(); wxString temp(FFMSErrMsg, wxConvUTF8); diff --git a/aegisub/src/video_provider_ffmpegsource.cpp b/aegisub/src/video_provider_ffmpegsource.cpp index 905e0028b..d4e50639f 100644 --- a/aegisub/src/video_provider_ffmpegsource.cpp +++ b/aegisub/src/video_provider_ffmpegsource.cpp @@ -51,7 +51,10 @@ // Constructor FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(Aegisub::String filename, double fps) { // initialize ffmpegsource - FFMS_Init(); + if (FFMS_Init()) { + FFMS_DeInit(); + throw _T("FFmpegSource video provider: failed to initialize FFMS2"); + } // clean up variables VideoSource = NULL; @@ -202,6 +205,7 @@ void FFmpegSourceVideoProvider::LoadVideo(Aegisub::String filename, double fps) void FFmpegSourceVideoProvider::Close() { FFMS_DestroyVideoSource(VideoSource); VideoSource = NULL; + FFMS_DeInit(); DstFormat = FFMS_GetPixFmt("none"); LastDstFormat = FFMS_GetPixFmt("none");