Commit 2092bd75 authored by Gildas Bazin's avatar Gildas Bazin Committed by Michael Niedermayer

avsync patch by (Gildas Bazin <gbazin at altern dot org>)

Originally committed as revision 2805 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 24515926
...@@ -836,6 +836,7 @@ static void mpegts_push_data(void *opaque, ...@@ -836,6 +836,7 @@ static void mpegts_push_data(void *opaque,
memcpy(pkt->data, p, len); memcpy(pkt->data, p, len);
pkt->stream_index = pes->st->index; pkt->stream_index = pes->st->index;
pkt->pts = pes->pts; pkt->pts = pes->pts;
pkt->dts = pes->dts;
/* reset pts values */ /* reset pts values */
pes->pts = AV_NOPTS_VALUE; pes->pts = AV_NOPTS_VALUE;
pes->dts = AV_NOPTS_VALUE; pes->dts = AV_NOPTS_VALUE;
......
...@@ -625,8 +625,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, ...@@ -625,8 +625,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
} else { } else {
/* presentation is not delayed : PTS and DTS are the same */ /* presentation is not delayed : PTS and DTS are the same */
if (pkt->pts == AV_NOPTS_VALUE) { if (pkt->pts == AV_NOPTS_VALUE) {
pkt->pts = st->cur_dts; if (pkt->dts == AV_NOPTS_VALUE) {
pkt->dts = st->cur_dts; pkt->pts = st->cur_dts;
pkt->dts = st->cur_dts;
}
else {
st->cur_dts = pkt->dts;
pkt->pts = pkt->dts;
}
} else { } else {
st->cur_dts = pkt->pts; st->cur_dts = pkt->pts;
pkt->dts = pkt->pts; pkt->dts = pkt->pts;
......
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