Unified · Split
| @@ -904,14 +904,6 @@ static int imf_probe(const AVProbeData *p) · 903 unmodified lines | |||
| 904 | return AVPROBE_SCORE_MAX; | 904 | return AVPROBE_SCORE_MAX; |
| 905 | } | 905 | } |
| 906 | 906 | ||
| 907 | static void rescale_interval(AVRational tb_in, AVRational tb_out, | ||
| 908 | int64_t *min_ts, int64_t *ts, int64_t *max_ts) | ||
| 909 | { | ||
| 910 | *ts = av_rescale_q(*ts, tb_in, tb_out); | ||
| 911 | *min_ts = av_rescale_q_rnd(*min_ts, tb_in, tb_out, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); | ||
| 912 | *max_ts = av_rescale_q_rnd(*max_ts, tb_in, tb_out, AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX); | ||
| 913 | } | ||
| 914 | |||
| 915 | static int coherent_ts(int64_t ts, AVRational in_tb, AVRational out_tb) | 907 | static int coherent_ts(int64_t ts, AVRational in_tb, AVRational out_tb) |
| 916 | { | 908 | { |
| 917 | int dst_num; | 909 | int dst_num; |
| @@ -937,13 +929,13 @@ static int imf_seek(AVFormatContext *s, int stream_index, int64_t min_ts, · 19 unmodified lines | |||
| 937 | 929 | ||
| 938 | /* rescale timestamps to Composition edit units */ | 930 | /* rescale timestamps to Composition edit units */ |
| 939 | if (stream_index < 0) | 931 | if (stream_index < 0) |
| 940 | rescale_interval(AV_TIME_BASE_Q, | 932 | ff_rescale_interval(AV_TIME_BASE_Q, |
| 941 | av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), | 933 | av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), |
| 942 | &min_ts, &ts, &max_ts); | 934 | &min_ts, &ts, &max_ts); |
| 943 | else | 935 | else |
| 944 | rescale_interval(s->streams[stream_index]->time_base, | 936 | ff_rescale_interval(s->streams[stream_index]->time_base, |
| 945 | av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), | 937 | av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), |
| 946 | &min_ts, &ts, &max_ts); | 938 | &min_ts, &ts, &max_ts); |
| 947 | 939 | ||
| 948 | /* requested timestamp bounds are too close */ | 940 | /* requested timestamp bounds are too close */ |
| 949 | if (max_ts < min_ts) | 941 | if (max_ts < min_ts) |