aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/srtenc.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2014-09-14 20:30:27 +0200
committerClément Bœsch <u@pkh.me>2014-09-30 20:21:14 +0200
commit55180b3299c61e5e3d16f1e9ea58dba8b787cc8e (patch)
tree9984561f4546525c823dfad5051c749533aa46a9 /libavformat/srtenc.c
parentd5ddcb5f8e7b14974fabd5e95e6420c6e9b12991 (diff)
downloadffmpeg-55180b3299c61e5e3d16f1e9ea58dba8b787cc8e.tar.gz
Kill timed SRT
Diffstat (limited to 'libavformat/srtenc.c')
-rw-r--r--libavformat/srtenc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavformat/srtenc.c b/libavformat/srtenc.c
index b43504bdc4..9bb83d645d 100644
--- a/libavformat/srtenc.c
+++ b/libavformat/srtenc.c
@@ -45,8 +45,7 @@ static int srt_write_header(AVFormatContext *avf)
return AVERROR(EINVAL);
}
if (avf->streams[0]->codec->codec_id != AV_CODEC_ID_TEXT &&
- avf->streams[0]->codec->codec_id != AV_CODEC_ID_SUBRIP &&
- avf->streams[0]->codec->codec_id != AV_CODEC_ID_SRT) {
+ avf->streams[0]->codec->codec_id != AV_CODEC_ID_SUBRIP) {
av_log(avf, AV_LOG_ERROR,
"Unsupported subtitles codec: %s\n",
avcodec_get_name(avf->streams[0]->codec->codec_id));
@@ -60,9 +59,8 @@ static int srt_write_header(AVFormatContext *avf)
static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
{
SRTContext *srt = avf->priv_data;
- int write_ts = avf->streams[0]->codec->codec_id != AV_CODEC_ID_SRT;
- if (write_ts) {
+ // TODO: reindent
int64_t s = pkt->pts, e, d = pkt->duration;
int size, x1 = -1, y1 = -1, x2 = -1, y2 = -1;
const uint8_t *p;
@@ -94,10 +92,9 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
avio_printf(avf->pb, " X1:%03d X2:%03d Y1:%03d Y2:%03d",
x1, x2, y1, y2);
avio_printf(avf->pb, "\n");
- }
+
avio_write(avf->pb, pkt->data, pkt->size);
- if (write_ts)
- avio_write(avf->pb, "\n\n", 2);
+ avio_write(avf->pb, "\n\n", 2);
srt->index++;
return 0;
}