Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-10-21 04:49:01 +0400
committerClément Bœsch <ubitux@gmail.com>2012-10-25 02:17:46 +0400
commitfd090a5d09238a4c641816e9af63d5fcb08f3115 (patch)
tree3cbc26c6a75515f2fd2daf6477357a3663534474 /libavformat/srtenc.c
parentc27b3816e4a7bf2047820ba47664ed1c874216c1 (diff)
lavf/srtenc: simplify timing printing.
Diffstat (limited to 'libavformat/srtenc.c')
-rw-r--r--libavformat/srtenc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavformat/srtenc.c b/libavformat/srtenc.c
index 0b094b00bf..42a264e70c 100644
--- a/libavformat/srtenc.c
+++ b/libavformat/srtenc.c
@@ -60,9 +60,7 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
srt->index++;
if (write_ts) {
- char buf[64];
int64_t s = pkt->pts, e, d = pkt->duration;
- int len;
if (d <= 0)
/* For backward compatibility, fallback to convergence_duration. */
@@ -72,14 +70,12 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
return AVERROR(EINVAL);
}
e = s + d;
- len = snprintf(buf, sizeof(buf),
- "%d\n%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d\n",
+ avio_printf(avf->pb, "%d\n%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d\n",
srt->index,
(int)(s / 3600000), (int)(s / 60000) % 60,
(int)(s / 1000) % 60, (int)(s % 1000),
(int)(e / 3600000), (int)(e / 60000) % 60,
(int)(e / 1000) % 60, (int)(e % 1000));
- avio_write(avf->pb, buf, len);
}
avio_write(avf->pb, pkt->data, pkt->size);
if (write_ts)