Skip to content
Extraits de code Groupes Projets
Valider 9b4f389f rédigé par Karl Blomster's avatar Karl Blomster
Parcourir les fichiers

ffmpegsource video provider now cleans up after itself properly even if...

ffmpegsource video provider now cleans up after itself properly even if loading the video file failed

Originally committed to SVN as r2373.
parent cc85096b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -58,7 +58,12 @@ FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(Aegisub::String filename, d
MessageSize = sizeof(FFMSErrorMessage);
// and here we go
try {
LoadVideo(filename, fps);
} catch (...) {
Close();
throw;
}
}
///////////////
......@@ -92,12 +97,14 @@ void FFmpegSourceVideoProvider::LoadVideo(Aegisub::String filename, double fps)
Progress.ProgressDialog->Show();
Progress.ProgressDialog->SetProgress(0,1);
Index = FFMS_MakeIndex(FileNameWX.char_str(), 0, "", FFmpegSourceVideoProvider::UpdateIndexingProgress, &Progress, FFMSErrorMessage, MessageSize);
Index = FFMS_MakeIndex(FileNameWX.char_str(), 1, NULL, FFmpegSourceVideoProvider::UpdateIndexingProgress, &Progress, FFMSErrorMessage, MessageSize);
if (Index == NULL) {
Progress.ProgressDialog->Destroy();
ErrorMsg.Printf(_T("FFmpegSource video provider: %s"), FFMSErrorMessage);
throw ErrorMsg;
}
Progress.ProgressDialog->Destroy();
// write it to disk
if (FFMS_WriteIndex(CacheName.char_str(), Index, FFMSErrorMessage, MessageSize)) {
ErrorMsg.Printf(_T("FFmpegSource video provider: %s"), FFMSErrorMessage);
......
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