Skip to content
Extraits de code Groupes Projets
Valider e924197c rédigé par Niels Martin Hansen's avatar Niels Martin Hansen
Parcourir les fichiers

Make the libass fonts_dir something sensible so it doesn't search the entire...

Make the libass fonts_dir something sensible so it doesn't search the entire homedir (or whereever) through for fonts on init, causing huge delays.
(?user/libass_fonts/ is used now, it's created if it doesn't exist.)

Originally committed to SVN as r2468.
parent 95bccb4e
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#include "ass_file.h" #include "ass_file.h"
#include "video_context.h" #include "video_context.h"
#include "utils.h" #include "utils.h"
#include "standard_paths.h"
#include <wx/filefn.h>
/////////////// ///////////////
...@@ -53,7 +55,12 @@ LibassSubtitlesProvider::LibassSubtitlesProvider() { ...@@ -53,7 +55,12 @@ LibassSubtitlesProvider::LibassSubtitlesProvider() {
ass_library = ass_library_init(); ass_library = ass_library_init();
if (!ass_library) throw _T("ass_library_init failed"); if (!ass_library) throw _T("ass_library_init failed");
ass_set_fonts_dir(ass_library, ""); wxString fonts_dir = StandardPaths::DecodePath(_T("?user/libass_fonts/"));
if (!wxDirExists(fonts_dir))
// It's only one level below the user dir, and we assume the user dir already exists at this point.
wxMkdir(fonts_dir);
ass_set_fonts_dir(ass_library, fonts_dir.mb_str(wxConvFile));
ass_set_extract_fonts(ass_library, 0); ass_set_extract_fonts(ass_library, 0);
ass_set_style_overrides(ass_library, NULL); ass_set_style_overrides(ass_library, NULL);
first = false; first = false;
......
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