Commit 42aa0241 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mpegts: Use DVB_TELETEXT timestamp heuristic also for DVB subtitles

Fixes Ticket4200
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d06ea6e5
...@@ -1140,7 +1140,10 @@ skip: ...@@ -1140,7 +1140,10 @@ skip:
p += 5; p += 5;
buf_size -= 5; buf_size -= 5;
} }
if (pes->ts->fix_teletext_pts && pes->st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) { if ( pes->ts->fix_teletext_pts
&& ( pes->st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT
|| pes->st->codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE)
) {
AVProgram *p = NULL; AVProgram *p = NULL;
while ((p = av_find_program_from_stream(pes->stream, p, pes->st->index))) { while ((p = av_find_program_from_stream(pes->stream, p, pes->st->index))) {
if (p->pcr_pid != -1 && p->discard != AVDISCARD_ALL) { if (p->pcr_pid != -1 && p->discard != AVDISCARD_ALL) {
...@@ -1169,7 +1172,11 @@ skip: ...@@ -1169,7 +1172,11 @@ skip:
pes->st->pts_wrap_behavior = st->pts_wrap_behavior; pes->st->pts_wrap_behavior = st->pts_wrap_behavior;
if (pes->dts == AV_NOPTS_VALUE || pes->dts < pcr) { if (pes->dts == AV_NOPTS_VALUE || pes->dts < pcr) {
pes->pts = pes->dts = pcr; pes->pts = pes->dts = pcr;
} else if (pes->dts > pcr + 3654 + 9000) { } else if (pes->st->codec->codec_id == AV_CODEC_ID_DVB_TELETEXT &&
pes->dts > pcr + 3654 + 9000) {
pes->pts = pes->dts = pcr + 3654 + 9000;
} else if (pes->st->codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE &&
pes->dts > pcr + 10*90000) { //10sec
pes->pts = pes->dts = pcr + 3654 + 9000; pes->pts = pes->dts = pcr + 3654 + 9000;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment