comparison utils.c @ 572:640706a29efb libavformat

bug in libavformat av_update_cur_dts(), patch by (Nathan Kurz <nate at verse dot com>)
author michael
date Fri, 22 Oct 2004 13:15:18 +0000
parents d82ccc7cff1c
children 8305c0755df7
comparison
equal deleted inserted replaced
571:4a755492b90b 572:640706a29efb
914 st->cur_dts = 0; /* we set the current DTS to an unspecified origin */ 914 st->cur_dts = 0; /* we set the current DTS to an unspecified origin */
915 } 915 }
916 } 916 }
917 917
918 /** 918 /**
919 * updates the cur_dts field based on the given timestamp and AVStream. 919 * updates cur_dts of all streams based on given timestamp and AVStream.
920 * only needed if (dts are not set and pts!=dts) or for timestamp wrapping 920 * stream ref_st unchanged, others set cur_dts in their native timebase
921 */ 921 * only needed for timestamp wrapping or if (dts not set and pts!=dts)
922 static void av_update_cur_dts(AVFormatContext *s, AVStream *st, int64_t timestamp){ 922 * @param timestamp new dts expressed in time_base of param ref_st
923 * @param ref_st reference stream giving time_base of param timestamp
924 */
925 static void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp){
923 int i; 926 int i;
924 927
925 for(i = 0; i < s->nb_streams; i++) { 928 for(i = 0; i < s->nb_streams; i++) {
926 AVStream *st2 = s->streams[i]; 929 AVStream *st = s->streams[i];
927 930
928 st->cur_dts = av_rescale(timestamp, 931 st->cur_dts = av_rescale(timestamp,
929 st2->time_base.den * (int64_t)st ->time_base.num, 932 st->time_base.den * (int64_t)ref_st->time_base.num,
930 st ->time_base.den * (int64_t)st2->time_base.num); 933 st->time_base.num * (int64_t)ref_st->time_base.den);
931 } 934 }
932 } 935 }
933 936
934 /** 937 /**
935 * add a index entry into a sorted list updateing if it is already there. 938 * add a index entry into a sorted list updateing if it is already there.