diff options
author | Oded Shimon <ods15@ods15.dyndns.org> | 2008-02-04 10:48:41 +0000 |
---|---|---|
committer | Oded Shimon <ods15@ods15.dyndns.org> | 2008-02-04 10:48:41 +0000 |
commit | 4ddcc983b40ce9904cc7136f3cb7af75299e1234 (patch) | |
tree | c40bd64241e6fbdf458064033013f58715e50bb7 /libavformat/nutenc.c | |
parent | 02c986a8d66e29ab52d1489273ef4d6f8fd4aac0 (diff) | |
download | ffmpeg-4ddcc983b40ce9904cc7136f3cb7af75299e1234.tar.gz |
back_ptr calculation used wrong timebase when searching for back syncpoint
Originally committed as revision 11856 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/nutenc.c')
-rw-r--r-- | libavformat/nutenc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 51c7633ae7..9a17c7759f 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -476,7 +476,11 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt){ ff_nut_reset_ts(nut, *nus->time_base, pkt->dts); for(i=0; i<s->nb_streams; i++){ AVStream *st= s->streams[i]; - int index= av_index_search_timestamp(st, pkt->dts, AVSEEK_FLAG_BACKWARD); + int64_t dts_tb = av_rescale_rnd(pkt->dts, + nus->time_base->num * (int64_t)nut->stream[i].time_base->den, + nus->time_base->den * (int64_t)nut->stream[i].time_base->num, + AV_ROUND_DOWN); + int index= av_index_search_timestamp(st, dts_tb, AVSEEK_FLAG_BACKWARD); if(index>=0) dummy.pos= FFMIN(dummy.pos, st->index_entries[index].pos); } if(dummy.pos == INT64_MAX) |