sub/lavc_conv: don't strip ASS style header

This fixes converted subtitles that are styled.

This reverts commit 5e2c211a4e.

Most of the subtitle decoders in libavcodec sets meaningful style
values. For the rest we can conditionally strip style.
This commit is contained in:
Kacper Michajłow 2024-03-23 10:10:27 +01:00
parent 4aa7588e44
commit d8378dc226
1 changed files with 0 additions and 15 deletions

View File

@ -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: