diff --git a/aegisub/src/audio_provider_ffmpegsource.cpp b/aegisub/src/audio_provider_ffmpegsource.cpp index fdedc3a46..6b871175d 100644 --- a/aegisub/src/audio_provider_ffmpegsource.cpp +++ b/aegisub/src/audio_provider_ffmpegsource.cpp @@ -145,12 +145,12 @@ void FFmpegSourceAudioProvider::LoadAudio(Aegisub::String filename) { } // no valid index exists and the file only has one audio track, index all tracks else if (TrackNumber < 0) - TrackNumber = FFMSTrackMaskAll; + TrackNumber = FFMS_TRACKMASK_ALL; // else: do nothing (keep track mask as it is) // moment of truth if (!IndexIsValid) { - int TrackMask = Options.AsBool(_T("FFmpegSource always index all tracks")) ? FFMSTrackMaskAll : 1 << TrackNumber; + int TrackMask = Options.AsBool(_T("FFmpegSource always index all tracks")) ? FFMS_TRACKMASK_ALL : 1 << TrackNumber; try { Index = DoIndexing(Indexer, CacheName, TrackMask, false); } catch (wxString temp) { diff --git a/aegisub/src/ffmpegsource_common.cpp b/aegisub/src/ffmpegsource_common.cpp index 0468c55f5..a39e09cb5 100644 --- a/aegisub/src/ffmpegsource_common.cpp +++ b/aegisub/src/ffmpegsource_common.cpp @@ -85,7 +85,7 @@ FFIndex *FFmpegSourceProvider::DoIndexing(FFIndexer *Indexer, const wxString &Ca Progress.ProgressDialog->SetProgress(0,1); // index all audio tracks - FFIndex *Index = FFMS_DoIndexing(Indexer, Trackmask, FFMSTrackMaskNone, NULL, NULL, IgnoreDecodeErrors, + FFIndex *Index = FFMS_DoIndexing(Indexer, Trackmask, FFMS_TRACKMASK_NONE, NULL, NULL, IgnoreDecodeErrors, FFmpegSourceProvider::UpdateIndexingProgress, &Progress, FFMSErrMsg, MsgSize); if (Index == NULL) { Progress.ProgressDialog->Destroy(); diff --git a/aegisub/src/ffmpegsource_common.h b/aegisub/src/ffmpegsource_common.h index ded8dee37..6eaea5333 100644 --- a/aegisub/src/ffmpegsource_common.h +++ b/aegisub/src/ffmpegsource_common.h @@ -45,12 +45,13 @@ #include "dialog_progress.h" +#define FFMS_TRACKMASK_ALL 0 +#define FFMS_TRACKMASK_NONE -1 + + class FFmpegSourceProvider { friend class FFmpegSourceCacheCleaner; public: - static const int FFMSTrackMaskAll = -1; - static const int FFMSTrackMaskNone = 0; - struct IndexingProgressDialog { volatile bool IndexingCanceled; DialogProgress *ProgressDialog; diff --git a/aegisub/src/video_provider_ffmpegsource.cpp b/aegisub/src/video_provider_ffmpegsource.cpp index 8a60a881c..de3409837 100644 --- a/aegisub/src/video_provider_ffmpegsource.cpp +++ b/aegisub/src/video_provider_ffmpegsource.cpp @@ -156,14 +156,14 @@ void FFmpegSourceVideoProvider::LoadVideo(Aegisub::String filename, double fps) // moment of truth if (!IndexIsValid) { - int TrackMask = Options.AsBool(_T("FFmpegSource always index all tracks")) ? FFMSTrackMaskAll : FFMSTrackMaskNone; + int TrackMask = Options.AsBool(_T("FFmpegSource always index all tracks")) ? FFMS_TRACKMASK_ALL : FFMS_TRACKMASK_NONE; try { try { // ignore audio decoding errors here, we don't care right now Index = DoIndexing(Indexer, CacheName, TrackMask, true); } catch (...) { // something borked, try if it works without audio - Index = DoIndexing(Indexer, CacheName, FFMSTrackMaskNone, true); + Index = DoIndexing(Indexer, CacheName, FFMS_TRACKMASK_NONE, true); } } catch (wxString temp) { ErrorMsg.Append(temp);