aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-05-01 15:16:34 +0200
committerClément Bœsch <u@pkh.me>2016-05-01 15:16:50 +0200
commit9f3dd530500e898b5ee4106b448562602371ae71 (patch)
tree6626b2e8f4f583694997aca8d69f070f4ee1fdf5
parentbbf02f7d288681d2ba6d522a99e6341dc3984247 (diff)
downloadffmpeg-9f3dd530500e898b5ee4106b448562602371ae71.tar.gz
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: Jean First <jeanfirst@gmail.com>
-rw-r--r--libavcodec/srtenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c
index 51439843b9..34f0f0d5e6 100644
--- a/libavcodec/srtenc.c
+++ b/libavcodec/srtenc.c
@@ -250,7 +250,8 @@ static int encode_frame(AVCodecContext *avctx,
dialog = ff_ass_split_dialog(s->ass_ctx, ass, 0, &num);
for (; dialog && num--; dialog++) {
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);
}
} else {
@@ -259,7 +260,8 @@ static int encode_frame(AVCodecContext *avctx,
if (!dialog)
return AVERROR(ENOMEM);
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_free_dialog(&dialog);
#if FF_API_ASS_TIMING