summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2010-06-01 22:49:22 +0200
committerGrigori Goronzy <greg@blackbox>2010-06-01 23:15:41 +0200
commitb784346e789814362e196e513a8988cd02d96bac (patch)
treee9d9665f9bf5c26d3b04ec52b73e5b89a25324d9 /mplayer.c
parent2fcd4cf73e1a06119e5c3284abe05942967ce3ad (diff)
downloadmpv-b784346e789814362e196e513a8988cd02d96bac.tar.bz2
mpv-b784346e789814362e196e513a8988cd02d96bac.tar.xz
libass: match font attachments based on extension
Instead of only relying on the MIME type, use the file extension as a fallback for deciding which attachments are fonts and should be fed to libass. This also refactors the check into a separate function in mpcommon.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mplayer.c b/mplayer.c
index fdead085ba..6be87667cc 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3756,10 +3756,7 @@ if (opts->ass_enabled && ass_library) {
struct demuxer *d = mpctx->sources[j].demuxer;
for (int i = 0; i < d->num_attachments; i++) {
struct demux_attachment *att = d->attachments + i;
- if (use_embedded_fonts
- && att->name && att->type && att->data && att->data_size
- && (strcmp(att->type, "application/x-truetype-font") == 0
- || strcmp(att->type, "application/x-font") == 0))
+ if (use_embedded_fonts && attachment_is_font(att))
ass_add_font(ass_library, att->name, att->data, att->data_size);
}
}