Skip to content
Extraits de code Groupes Projets
Valider 73cc2d21 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Check the error code when FFMS2 can't create an indexer

Creating an indexer can fail for reasons other than the file not
existing. This check is still not completely correct, since FFMS2 uses
the wrong error codes in a bunch of places.
parent f8a6c71a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -76,8 +76,12 @@ void FFmpegSourceAudioProvider::LoadAudio(wxString filename) { ...@@ -76,8 +76,12 @@ void FFmpegSourceAudioProvider::LoadAudio(wxString filename) {
wxString FileNameShort = wxFileName(filename).GetShortPath(); wxString FileNameShort = wxFileName(filename).GetShortPath();
FFMS_Indexer *Indexer = FFMS_CreateIndexer(FileNameShort.utf8_str(), &ErrInfo); FFMS_Indexer *Indexer = FFMS_CreateIndexer(FileNameShort.utf8_str(), &ErrInfo);
if (!Indexer) if (!Indexer) {
if (ErrInfo.SubType == FFMS_ERROR_FILE_READ)
throw agi::FileNotFoundError(ErrInfo.Buffer); throw agi::FileNotFoundError(ErrInfo.Buffer);
else
throw agi::AudioDataNotFoundError(ErrInfo.Buffer, 0);
}
std::map<int,wxString> TrackList = GetTracksOfType(Indexer, FFMS_TYPE_AUDIO); std::map<int,wxString> TrackList = GetTracksOfType(Indexer, FFMS_TYPE_AUDIO);
if (TrackList.size() <= 0) if (TrackList.size() <= 0)
......
...@@ -89,8 +89,12 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) { ...@@ -89,8 +89,12 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
wxString FileNameShort = wxFileName(filename).GetShortPath(); wxString FileNameShort = wxFileName(filename).GetShortPath();
FFMS_Indexer *Indexer = FFMS_CreateIndexer(FileNameShort.utf8_str(), &ErrInfo); FFMS_Indexer *Indexer = FFMS_CreateIndexer(FileNameShort.utf8_str(), &ErrInfo);
if (!Indexer) if (!Indexer) {
if (ErrInfo.SubType == FFMS_ERROR_FILE_READ)
throw agi::FileNotFoundError(ErrInfo.Buffer); throw agi::FileNotFoundError(ErrInfo.Buffer);
else
throw VideoNotSupported(ErrInfo.Buffer);
}
std::map<int,wxString> TrackList = GetTracksOfType(Indexer, FFMS_TYPE_VIDEO); std::map<int,wxString> TrackList = GetTracksOfType(Indexer, FFMS_TYPE_VIDEO);
if (TrackList.size() <= 0) if (TrackList.size() <= 0)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter