[FFmpeg-cvslog] avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay

Michael Niedermayer git at videolan.org
Sat Mar 26 22:36:05 CET 2016


ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Tue Mar  8 02:42:10 2016 +0100| [756f4b586ae758f11d4b115e5b4595cdef1d3af3] | committer: Michael Niedermayer

avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit de1de4932419d0fb49c9c23f62e68cdbe90d0ee3)

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

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

 libavformat/utils.c |    5 +++--
 tests/ref/fate/mkv  |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 129a49d..3aa5beb 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1186,12 +1186,13 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
         }
     }
 
-    if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)) {
+    if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) {
         st->pts_buffer[0] = pkt->pts;
         for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
             FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
 
-        pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts);
+        if(has_decode_delay_been_guessed(st))
+            pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts);
     }
     // We skipped it above so we try here.
     if (!onein_oneout)
diff --git a/tests/ref/fate/mkv b/tests/ref/fate/mkv
index aea378a..765798c 100644
--- a/tests/ref/fate/mkv
+++ b/tests/ref/fate/mkv
@@ -25,9 +25,9 @@
 1,        264,        264,       21,      609, 0xc0dc255c
 1,        285,        285,       21,      619, 0x9ac52dd1
 0,        292,        292,       41,    16751, 0xf293ab46, F=0x0
-0,        292,        417,       41,    22029, 0x3696462b, F=0x0
 1,        306,        306,       21,      574, 0xf6410d4d
 1,        327,        327,       22,      565, 0xfd561191
+0,        334,        417,       41,    22029, 0x3696462b, F=0x0
 1,        350,        350,       21,      713, 0x48425147
 1,        371,        371,       21,      537, 0x09bbf515
 0,        375,        375,       41,     5044, 0xa0344ae6, F=0x0



More information about the ffmpeg-cvslog mailing list