[FFmpeg-cvslog] avformat/utils: do not override pts in h264 when they are provided from the demuxer

Michael Niedermayer git at videolan.org
Sun Oct 27 19:59:08 CET 2013


ffmpeg | branch: release/0.9 | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 27 01:03:19 2013 +0200| [b6f5a54fddeb968eb9fb51c1d0111ea448a31fe5] | committer: Carl Eugen Hoyos

avformat/utils: do not override pts in h264 when they are provided from the demuxer

Fixes Ticket2143

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 1e5271a9fd6ddcceb083f2185a4bbd8d44c9a813)

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

 libavformat/utils.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index b0d1ec3..4817507 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1076,12 +1076,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
             if (pkt->dts != AV_NOPTS_VALUE) {
                 // got DTS from the stream, update reference timestamp
                 st->reference_dts = pkt->dts - pc->dts_ref_dts_delta * num / den;
-                pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
             } else if (st->reference_dts != AV_NOPTS_VALUE) {
                 // compute DTS based on reference timestamp
                 pkt->dts = st->reference_dts + pc->dts_ref_dts_delta * num / den;
-                pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
             }
+
+            if (st->reference_dts != AV_NOPTS_VALUE && pkt->pts == AV_NOPTS_VALUE)
+                pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
+
             if (pc->dts_sync_point > 0)
                 st->reference_dts = pkt->dts; // new reference
         }



More information about the ffmpeg-cvslog mailing list