summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorTheAMM <the.actual.amm@gmail.com>2021-05-29 01:28:15 +0300
committerJan Ekström <jeebjp@gmail.com>2021-07-08 12:44:06 +0300
commit4d3df1c842532e3a48578ab6daef39076289c8ef (patch)
treef38668f28dca977818525416494c162f42f65b51 /player
parentf9527497c68c86b247ade965dafe362f0f43be09 (diff)
downloadmpv-4d3df1c842532e3a48578ab6daef39076289c8ef.tar.bz2
mpv-4d3df1c842532e3a48578ab6daef39076289c8ef.tar.xz
recorder: add support for attachments (fonts)
Though, only when the output format is matroska, to avoid muxing errors. This is quite useful when the input has ASS subtitles, as they tend to rely on embedded fonts.
Diffstat (limited to 'player')
-rw-r--r--player/loadfile.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 6032cf6193..e992df694f 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1959,11 +1959,18 @@ void open_recorder(struct MPContext *mpctx, bool on_init)
MP_TARRAY_APPEND(NULL, streams, num_streams, track->stream);
}
+ struct demux_attachment **attachments = talloc_array(NULL, struct demux_attachment*, mpctx->demuxer->num_attachments);
+ for (int n = 0; n < mpctx->demuxer->num_attachments; n++) {
+ attachments[n] = &mpctx->demuxer->attachments[n];
+ }
+
mpctx->recorder = mp_recorder_create(mpctx->global, mpctx->opts->record_file,
- streams, num_streams);
+ streams, num_streams,
+ attachments, mpctx->demuxer->num_attachments);
if (!mpctx->recorder) {
talloc_free(streams);
+ talloc_free(attachments);
close_recorder_and_error(mpctx);
return;
}
@@ -1987,5 +1994,6 @@ void open_recorder(struct MPContext *mpctx, bool on_init)
}
talloc_free(streams);
+ talloc_free(attachments);
}