aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGildas Bazin <gbazi@altern.org>2004-02-20 14:39:15 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-20 14:39:15 +0000
commit2092bd7531f30b07f1188b2a28cf67a42d4bd8e4 (patch)
tree232a33056d7c6ac3f1a12a7a7544e85fcdf5fbe0
parent245159265267f0636142114cef3ea33b26e99510 (diff)
downloadffmpeg-2092bd7531f30b07f1188b2a28cf67a42d4bd8e4.tar.gz
avsync patch by (Gildas Bazin <gbazin at altern dot org>)
Originally committed as revision 2805 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mpegts.c1
-rw-r--r--libavformat/utils.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2ad5aa5c76..f74916f9b7 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -836,6 +836,7 @@ static void mpegts_push_data(void *opaque,
memcpy(pkt->data, p, len);
pkt->stream_index = pes->st->index;
pkt->pts = pes->pts;
+ pkt->dts = pes->dts;
/* reset pts values */
pes->pts = AV_NOPTS_VALUE;
pes->dts = AV_NOPTS_VALUE;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2f60c77c74..8f9b97e7b0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -625,8 +625,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
} else {
/* presentation is not delayed : PTS and DTS are the same */
if (pkt->pts == AV_NOPTS_VALUE) {
- pkt->pts = st->cur_dts;
- pkt->dts = st->cur_dts;
+ if (pkt->dts == AV_NOPTS_VALUE) {
+ pkt->pts = st->cur_dts;
+ pkt->dts = st->cur_dts;
+ }
+ else {
+ st->cur_dts = pkt->dts;
+ pkt->pts = pkt->dts;
+ }
} else {
st->cur_dts = pkt->pts;
pkt->dts = pkt->pts;