[FFmpeg-cvslog] avformat/mpegts: Use DVB_TELETEXT timestamp heuristic also for DVB subtitles

Michael Niedermayer git at videolan.org
Mon Jul 27 15:59:32 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Jul 27 15:13:50 2015 +0200| [42aa02418e43802b4ebcca373d2413ab63a0307e] | committer: Michael Niedermayer

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

Fixes Ticket4200

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42aa02418e43802b4ebcca373d2413ab63a0307e
---

 libavformat/mpegts.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 689b31d..b758ae3 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1140,7 +1140,10 @@ skip:
                     p += 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;
                     while ((p = av_find_program_from_stream(pes->stream, p, pes->st->index))) {
                         if (p->pcr_pid != -1 && p->discard != AVDISCARD_ALL) {
@@ -1169,7 +1172,11 @@ skip:
                                     pes->st->pts_wrap_behavior = st->pts_wrap_behavior;
                                     if (pes->dts == AV_NOPTS_VALUE || 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;
                                     }
                                     break;



More information about the ffmpeg-cvslog mailing list