diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2024-03-23 10:10:27 +0100 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-04-27 01:14:23 +0200 |
commit | d8378dc226ad6be2a52ddaa0ca585838c28fe1a3 (patch) | |
tree | 75a6740f0c30c87826e28829ca454dd22769ca6b /sub/lavc_conv.c | |
parent | 4aa7588e44bbe3f68ca89f90d592d53b6614e575 (diff) | |
download | mpv-d8378dc226ad6be2a52ddaa0ca585838c28fe1a3.tar.bz2 mpv-d8378dc226ad6be2a52ddaa0ca585838c28fe1a3.tar.xz |
sub/lavc_conv: don't strip ASS style header
This fixes converted subtitles that are styled.
This reverts commit 5e2c211a4e1d67748348295b191acb2dfb76d024.
Most of the subtitle decoders in libavcodec sets meaningful style
values. For the rest we can conditionally strip style.
Diffstat (limited to 'sub/lavc_conv.c')
-rw-r--r-- | sub/lavc_conv.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c index 605a58b585..f269da3698 100644 --- a/sub/lavc_conv.c +++ b/sub/lavc_conv.c @@ -53,20 +53,6 @@ static const char *get_lavc_format(const char *format) return format; } -// Disable style definitions generated by the libavcodec converter. -// We always want the user defined style instead. -static void disable_styles(bstr header) -{ - bstr style = bstr0("\nStyle: "); - while (header.len) { - int n = bstr_find(header, style); - if (n < 0) - break; - header.start[n + 1] = '#'; // turn into a comment - header = bstr_cut(header, n + style.len); - } -} - struct lavc_conv *lavc_conv_create(struct sd *sd) { struct lavc_conv *priv = talloc_zero(NULL, struct lavc_conv); @@ -116,7 +102,6 @@ struct lavc_conv *lavc_conv_create(struct sd *sd) priv->avctx = avctx; priv->extradata = talloc_strndup(priv, avctx->subtitle_header, avctx->subtitle_header_size); - disable_styles(bstr0(priv->extradata)); return priv; error: |