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 // no valid index exists and the file only has one audio track, index all tracks
else if (TrackNumber < 0) else if (TrackNumber < 0)
TrackNumber = FFMSTrackMaskAll; TrackNumber = FFMS_TRACKMASK_ALL;
// else: do nothing (keep track mask as it is) // else: do nothing (keep track mask as it is)
// moment of truth // moment of truth
if (!IndexIsValid) { 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 { try {
Index = DoIndexing(Indexer, CacheName, TrackMask, false); Index = DoIndexing(Indexer, CacheName, TrackMask, false);
} catch (wxString temp) { } catch (wxString temp) {

View file

@ -85,7 +85,7 @@ FFIndex *FFmpegSourceProvider::DoIndexing(FFIndexer *Indexer, const wxString &Ca
Progress.ProgressDialog->SetProgress(0,1); Progress.ProgressDialog->SetProgress(0,1);
// index all audio tracks // 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); FFmpegSourceProvider::UpdateIndexingProgress, &Progress, FFMSErrMsg, MsgSize);
if (Index == NULL) { if (Index == NULL) {
Progress.ProgressDialog->Destroy(); Progress.ProgressDialog->Destroy();

View file

@ -45,12 +45,13 @@
#include "dialog_progress.h" #include "dialog_progress.h"
#define FFMS_TRACKMASK_ALL 0
#define FFMS_TRACKMASK_NONE -1
class FFmpegSourceProvider { class FFmpegSourceProvider {
friend class FFmpegSourceCacheCleaner; friend class FFmpegSourceCacheCleaner;
public: public:
static const int FFMSTrackMaskAll = -1;
static const int FFMSTrackMaskNone = 0;
struct IndexingProgressDialog { struct IndexingProgressDialog {
volatile bool IndexingCanceled; volatile bool IndexingCanceled;
DialogProgress *ProgressDialog; DialogProgress *ProgressDialog;

View file

@ -156,14 +156,14 @@ void FFmpegSourceVideoProvider::LoadVideo(Aegisub::String filename, double fps)
// moment of truth // moment of truth
if (!IndexIsValid) { 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 {
try { try {
// ignore audio decoding errors here, we don't care right now // ignore audio decoding errors here, we don't care right now
Index = DoIndexing(Indexer, CacheName, TrackMask, true); Index = DoIndexing(Indexer, CacheName, TrackMask, true);
} catch (...) { } catch (...) {
// something borked, try if it works without audio // 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) { } catch (wxString temp) {
ErrorMsg.Append(temp); ErrorMsg.Append(temp);