forked from mia/Aegisub
Fix ffms2 providers to work with latest FFMS2 API changes.
Originally committed to SVN as r2974.
This commit is contained in:
parent
6b42083504
commit
edc10f752c
3 changed files with 11 additions and 3 deletions
|
@ -46,7 +46,10 @@
|
||||||
///////////
|
///////////
|
||||||
// Constructor
|
// Constructor
|
||||||
FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(Aegisub::String filename) {
|
FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(Aegisub::String filename) {
|
||||||
FFMS_Init();
|
if (FFMS_Init()) {
|
||||||
|
FFMS_DeInit();
|
||||||
|
throw _T("FFmpegSource audio provider: failed to initialize FFMS2");
|
||||||
|
}
|
||||||
|
|
||||||
MsgSize = sizeof(FFMSErrMsg);
|
MsgSize = sizeof(FFMSErrMsg);
|
||||||
MsgString = _T("FFmpegSource audio provider: ");
|
MsgString = _T("FFmpegSource audio provider: ");
|
||||||
|
@ -181,6 +184,7 @@ FFmpegSourceAudioProvider::~FFmpegSourceAudioProvider() {
|
||||||
void FFmpegSourceAudioProvider::Close() {
|
void FFmpegSourceAudioProvider::Close() {
|
||||||
FFMS_DestroyAudioSource(AudioSource);
|
FFMS_DestroyAudioSource(AudioSource);
|
||||||
AudioSource = NULL;
|
AudioSource = NULL;
|
||||||
|
FFMS_DeInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ FFIndex *FFmpegSourceProvider::DoIndexing(FFIndex *Index, wxString FileNameWX, w
|
||||||
Progress.ProgressDialog->SetProgress(0,1);
|
Progress.ProgressDialog->SetProgress(0,1);
|
||||||
|
|
||||||
// index all audio tracks
|
// 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) {
|
if (!Index) {
|
||||||
Progress.ProgressDialog->Destroy();
|
Progress.ProgressDialog->Destroy();
|
||||||
wxString temp(FFMSErrMsg, wxConvUTF8);
|
wxString temp(FFMSErrMsg, wxConvUTF8);
|
||||||
|
|
|
@ -51,7 +51,10 @@
|
||||||
// Constructor
|
// Constructor
|
||||||
FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(Aegisub::String filename, double fps) {
|
FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(Aegisub::String filename, double fps) {
|
||||||
// initialize ffmpegsource
|
// initialize ffmpegsource
|
||||||
FFMS_Init();
|
if (FFMS_Init()) {
|
||||||
|
FFMS_DeInit();
|
||||||
|
throw _T("FFmpegSource video provider: failed to initialize FFMS2");
|
||||||
|
}
|
||||||
|
|
||||||
// clean up variables
|
// clean up variables
|
||||||
VideoSource = NULL;
|
VideoSource = NULL;
|
||||||
|
@ -202,6 +205,7 @@ void FFmpegSourceVideoProvider::LoadVideo(Aegisub::String filename, double fps)
|
||||||
void FFmpegSourceVideoProvider::Close() {
|
void FFmpegSourceVideoProvider::Close() {
|
||||||
FFMS_DestroyVideoSource(VideoSource);
|
FFMS_DestroyVideoSource(VideoSource);
|
||||||
VideoSource = NULL;
|
VideoSource = NULL;
|
||||||
|
FFMS_DeInit();
|
||||||
|
|
||||||
DstFormat = FFMS_GetPixFmt("none");
|
DstFormat = FFMS_GetPixFmt("none");
|
||||||
LastDstFormat = FFMS_GetPixFmt("none");
|
LastDstFormat = FFMS_GetPixFmt("none");
|
||||||
|
|
Loading…
Reference in a new issue