diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2009-08-10 20:53:32 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2009-08-10 20:53:32 +0000 |
commit | 7a9c86e9f85f0de44d5bf648f595dddae614d991 (patch) | |
tree | 6d5d58a80a644c91a134a187b618b1e4790507c0 /libavformat | |
parent | 2bf74f4955b704bb1c954c8c51f35734697b45b9 (diff) | |
download | ffmpeg-streaming-7a9c86e9f85f0de44d5bf648f595dddae614d991.zip ffmpeg-streaming-7a9c86e9f85f0de44d5bf648f595dddae614d991.tar.gz |
avidec: simplify, using av_rescale_q() instead of av_rescale()
Originally committed as revision 19624 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avidec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 86e5357..71235ec 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -682,7 +682,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) if(ast->sample_size) ts /= ast->sample_size; - ts= av_rescale(ts, AV_TIME_BASE * (int64_t)st->time_base.num, st->time_base.den); + ts = av_rescale_q(ts, st->time_base, AV_TIME_BASE_Q); // av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset); if(ts < best_ts && st->nb_index_entries){ @@ -695,7 +695,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) return -1; best_ast = best_st->priv_data; - best_ts= av_rescale(best_ts, best_st->time_base.den, AV_TIME_BASE * (int64_t)best_st->time_base.num); //FIXME a little ugly + best_ts = av_rescale_q(best_ts, AV_TIME_BASE_Q, best_st->time_base); if(best_ast->remaining) i= av_index_search_timestamp(best_st, best_ts, AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD); else{ @@ -1086,7 +1086,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp assert((int64_t)st2->time_base.num*ast2->rate == (int64_t)st2->time_base.den*ast2->scale); index = av_index_search_timestamp( st2, - av_rescale(timestamp, st2->time_base.den*(int64_t)st->time_base.num, st->time_base.den * (int64_t)st2->time_base.num), + av_rescale_q(timestamp, st->time_base, st2->time_base), flags | AVSEEK_FLAG_BACKWARD); if(index<0) index=0; |