aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kurz <nate@verse.com>2004-10-22 13:15:18 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-10-22 13:15:18 +0000
commit1a1dc611ce973c372a0f49cdf92be50aed6970ac (patch)
tree3b7b7b9224b89a03cff39aeb2baa0af9143496c8
parentf02be79d61022f399bb08573fd42d068cdf75b7b (diff)
downloadffmpeg-1a1dc611ce973c372a0f49cdf92be50aed6970ac.tar.gz
bug in libavformat av_update_cur_dts(), patch by (Nathan Kurz <nate at verse dot com>)
Originally committed as revision 3622 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/utils.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1c0dd2939b..76a80eb6d8 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -916,18 +916,21 @@ static void av_read_frame_flush(AVFormatContext *s)
}
/**
- * updates the cur_dts field based on the given timestamp and AVStream.
- * only needed if (dts are not set and pts!=dts) or for timestamp wrapping
+ * updates cur_dts of all streams based on given timestamp and AVStream.
+ * stream ref_st unchanged, others set cur_dts in their native timebase
+ * only needed for timestamp wrapping or if (dts not set and pts!=dts)
+ * @param timestamp new dts expressed in time_base of param ref_st
+ * @param ref_st reference stream giving time_base of param timestamp
*/
-static void av_update_cur_dts(AVFormatContext *s, AVStream *st, int64_t timestamp){
+static void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp){
int i;
for(i = 0; i < s->nb_streams; i++) {
- AVStream *st2 = s->streams[i];
+ AVStream *st = s->streams[i];
st->cur_dts = av_rescale(timestamp,
- st2->time_base.den * (int64_t)st ->time_base.num,
- st ->time_base.den * (int64_t)st2->time_base.num);
+ st->time_base.den * (int64_t)ref_st->time_base.num,
+ st->time_base.num * (int64_t)ref_st->time_base.den);
}
}