Commit 9f3dd530 authored by Clément Bœsch's avatar Clément Bœsch

lavc/srtenc: do not emit any subrip tags with text codec

Fixes presence of opening tags when running
  ffmpeg -i x.ass -c text x.srt
Reported-by: 's avatarJean First <jeanfirst@gmail.com>
parent bbf02f7d
...@@ -250,7 +250,8 @@ static int encode_frame(AVCodecContext *avctx, ...@@ -250,7 +250,8 @@ static int encode_frame(AVCodecContext *avctx,
dialog = ff_ass_split_dialog(s->ass_ctx, ass, 0, &num); dialog = ff_ass_split_dialog(s->ass_ctx, ass, 0, &num);
for (; dialog && num--; dialog++) { for (; dialog && num--; dialog++) {
s->alignment_applied = 0; s->alignment_applied = 0;
srt_style_apply(s, dialog->style); if (avctx->codec_id == AV_CODEC_ID_SUBRIP)
srt_style_apply(s, dialog->style);
ff_ass_split_override_codes(cb, s, dialog->text); ff_ass_split_override_codes(cb, s, dialog->text);
} }
} else { } else {
...@@ -259,7 +260,8 @@ static int encode_frame(AVCodecContext *avctx, ...@@ -259,7 +260,8 @@ static int encode_frame(AVCodecContext *avctx,
if (!dialog) if (!dialog)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
s->alignment_applied = 0; s->alignment_applied = 0;
srt_style_apply(s, dialog->style); if (avctx->codec_id == AV_CODEC_ID_SUBRIP)
srt_style_apply(s, dialog->style);
ff_ass_split_override_codes(cb, s, dialog->text); ff_ass_split_override_codes(cb, s, dialog->text);
ff_ass_free_dialog(&dialog); ff_ass_free_dialog(&dialog);
#if FF_API_ASS_TIMING #if FF_API_ASS_TIMING
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment