1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

ffmpeg: ignore forward gaps for subtitles streams.

This commit is contained in:
Nicolas George 2011-08-16 15:49:17 +02:00
parent 05a267305d
commit 5fa98ab42d

View File

@ -2797,7 +2797,10 @@ static int transcode(AVFormatContext **output_files,
&& (is->iformat->flags & AVFMT_TS_DISCONT)) { && (is->iformat->flags & AVFMT_TS_DISCONT)) {
int64_t pkt_dts= av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q); int64_t pkt_dts= av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q);
int64_t delta= pkt_dts - ist->next_pts; int64_t delta= pkt_dts - ist->next_pts;
if((FFABS(delta) > 1LL*dts_delta_threshold*AV_TIME_BASE || pkt_dts+1<ist->pts)&& !copy_ts){ if((delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
(delta > 1LL*dts_delta_threshold*AV_TIME_BASE &&
ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) ||
pkt_dts+1<ist->pts)&& !copy_ts){
input_files[ist->file_index].ts_offset -= delta; input_files[ist->file_index].ts_offset -= delta;
if (verbose > 2) if (verbose > 2)
fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",