aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2011-08-16 15:49:17 +0200
committerNicolas George <nicolas.george@normalesup.org>2011-08-22 09:55:35 +0200
commit5fa98ab42d221c294b0b35ad3d2f6dd3170cc594 (patch)
tree3b424a2219986bfc574f24495147b9403be1f505 /ffmpeg.c
parent05a267305dd6c12ee1a9614b2aae539c3eab255e (diff)
downloadffmpeg-5fa98ab42d221c294b0b35ad3d2f6dd3170cc594.tar.gz
ffmpeg: ignore forward gaps for subtitles streams.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 8e2c29fe14..e305948ce4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2797,7 +2797,10 @@ static int transcode(AVFormatContext **output_files,
&& (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 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;
if (verbose > 2)
fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",