Fix ffms2 providers to work with latest FFMS2 API changes.

Originally committed to SVN as r2974.
This commit is contained in:
Karl Blomster 2009-05-22 21:44:02 +00:00
parent 6b42083504
commit edc10f752c
3 changed files with 11 additions and 3 deletions

View file

@ -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();
}

View file

@ -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);

View file

@ -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");