After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 575878 - assrender searches entire current working directory when searching for fonts to use
assrender searches entire current working directory when searching for fonts ...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal major
: 0.10.18
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-18 21:10 UTC by Eric Appleman
Modified: 2010-02-02 07:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Eric Appleman 2009-03-18 21:10:59 UTC
Please describe the problem:
It appears that assrender searches the ENTIRE current working directory for fonts even if the video has embedded fonts.

This is a rather slow way of doing things.

Instead, assrender should create a directory of its own for private font storage and point libass to that. 

Steps to reproduce:



Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Grigori 2010-02-02 00:25:15 UTC
Hi, a few comments from the current libass maintainer.

The directory set by ass_set_fonts_dir is added to the fontconfig search path. fontconfig recursively scans the directory later on. Also, embedded fonts, either added by ass_add_font or found in the track data, are extracted to the specified directory if an ancient (< 2.4.2) fontconfig version is used [1]. Very old versions of fontconfig weren't capable of dealing with fonts only stored in memory.

However, nowadays this isn't relevant anymore and the only purpose of the directory specified by ass_set_fonts_dir is to make additional fonts that are stored in the file system somewhere available to libass.
As the directory is *recursively* scanned, simply setting this to "./", i.e. the working directory, as assrender does at the moment, is downright harmful in some situations. Imagine playing a file from $HOME and having fontconfig scan your complete home directory with all subdirs and files -- this takes a long time.

It's safe to simply not call ass_set_fonts_dir. The only side effect is that libass will not be able to use embedded fonts if an ancient fontconfig version is used.

No patch attached since it's trivial. :)

[1] Also, precisely because of this the documentation in ass.h states the directory needs to be private for libass. If libass needs to extract fonts, it will overwrite files without mercy.
Comment 2 Sebastian Dröge (slomo) 2010-02-02 07:55:05 UTC
commit febb13d26f5b4c7154f3eedcadc90799573e4083
Author: Eric Appleman <erappleman@gmail.com>
Date:   Tue Feb 2 08:53:53 2010 +0100

    assrender: Don't scan current working directory recursively for fonts
    
    This can take a very long time and also libass will overwrite files
    if there's an embedded font with the same filename as an existing file.
    
    Fixes bug #575878 and #608706.