mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
fftools/ffmpeg_enc: ensure subtitle packet pts respects output start_time
In do_subtitle_out(), local_sub.pts already subtracts of->start_time when output-side -ss is requested. However, pkt->pts was assigned from sub->pts rather than the adjusted pts variable, causing cue headers to drift across container muxers whenever output seeking was used. Assign pkt->pts from pts so that encoded subtitle packets stay aligned with audio/video streams on the shifted timeline. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
1 parent
55718343aa
commit
7f2b4adeac
1 file changed
+1
-1
@@ -525,7 +525,7 @@ static int do_subtitle_out(OutputFile *of, OutputStream *ost, const AVSubtitle *
|
||||
|
||||
av_shrink_packet(pkt, subtitle_out_size);
|
||||
pkt->time_base = AV_TIME_BASE_Q;
|
||||
pkt->pts = sub->pts;
|
||||
pkt->pts = pts;
|
||||
pkt->duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, pkt->time_base);
|
||||
if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
|
||||
/* XXX: the pts correction is handled here. Maybe handling
|
||||
|
||||
Reference in new issue
Block a user