summaryrefslogtreecommitdiff
path: root/libavcodec/srtenc.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-12-30 00:56:48 +0100
committerClément Bœsch <ubitux@gmail.com>2012-12-30 21:39:36 +0100
commit1b673cd9ff32d53b9805503e69be93537c1dda87 (patch)
tree0ed225552f271340158684594f20862ab2201e6a /libavcodec/srtenc.c
parent3af3a3006f39ffe43a954ecb3811ac2c1d9c2d0f (diff)
downloadffmpeg-1b673cd9ff32d53b9805503e69be93537c1dda87.tar.gz
lavc/srtenc: do not add trailing line breaks with SubRip.
The SRT muxer is reponsible for separating events with two line breaks, there is no need to add more than necessary. Similarly, other muxers (such as Matroska) are not supposed to add line breaks at the end of the payload.
Diffstat (limited to 'libavcodec/srtenc.c')
-rw-r--r--libavcodec/srtenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c
index 739645b3bf..d72d338e06 100644
--- a/libavcodec/srtenc.c
+++ b/libavcodec/srtenc.c
@@ -218,8 +218,11 @@ static void srt_move_cb(void *priv, int x1, int y1, int x2, int y2,
static void srt_end_cb(void *priv)
{
+ SRTContext *s = priv;
+
srt_stack_push_pop(priv, 0, 1);
- srt_print(priv, "\r\n\r\n");
+ if (s->avctx->codec->id == AV_CODEC_ID_SRT)
+ srt_print(priv, "\r\n\r\n");
}
static const ASSCodesCallbacks srt_callbacks = {