[FFmpeg-devel] [PATCH] ffmpeg: Set duration on encoded subtitle packets.
Philip Langdale
philipl at overt.org
Thu May 31 06:08:01 CEST 2012
Currently, we don't set the duration on the packet of a newly
encoded subtitle. This information may be required by the
muxer.
Signed-off-by: Philip Langdale <philipl at overt.org>
---
ffmpeg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ffmpeg.c b/ffmpeg.c
index a97327b..521ed47 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1798,6 +1798,7 @@ static void do_subtitle_out(AVFormatContext *s,
pkt.data = subtitle_out;
pkt.size = subtitle_out_size;
pkt.pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->st->time_base);
+ pkt.duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->st->time_base);
if (enc->codec_id == CODEC_ID_DVB_SUBTITLE) {
/* XXX: the pts correction is handled here. Maybe handling
it in the codec would be better */
--
1.7.9.5
More information about the ffmpeg-devel
mailing list