Replace FFMSTrackMask[All|None] with #defines instead. (Was causing linking problems with some compilers for some reason).

Originally committed to SVN as r3155.
This commit is contained in:
Karl Blomster 2009-07-16 21:40:17 +00:00
parent 8af125b88c
commit 58539b885d
4 changed files with 9 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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