Commit acf51ff7 authored by michael's avatar michael

bug in libavformat av_update_cur_dts(), patch by (Nathan Kurz <nate at verse dot com>)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3622 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 50f4763b
...@@ -916,18 +916,21 @@ static void av_read_frame_flush(AVFormatContext *s) ...@@ -916,18 +916,21 @@ static void av_read_frame_flush(AVFormatContext *s)
} }
/** /**
* updates the cur_dts field based on the given timestamp and AVStream. * updates cur_dts of all streams based on given timestamp and AVStream.
* only needed if (dts are not set and pts!=dts) or for timestamp wrapping * 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; int i;
for(i = 0; i < s->nb_streams; 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, st->cur_dts = av_rescale(timestamp,
st2->time_base.den * (int64_t)st ->time_base.num, st->time_base.den * (int64_t)ref_st->time_base.num,
st ->time_base.den * (int64_t)st2->time_base.num); st->time_base.num * (int64_t)ref_st->time_base.den);
} }
} }
......
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