Unified · Split
| @@ -816,16 +816,6 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt) · 815 unmodified lines | |||
| 816 | return 0; | 816 | return 0; |
| 817 | } | 817 | } |
| 818 | 818 | ||
| 819 | static void rescale_interval(AVRational tb_in, AVRational tb_out, | ||
| 820 | int64_t *min_ts, int64_t *ts, int64_t *max_ts) | ||
| 821 | { | ||
| 822 | *ts = av_rescale_q (* ts, tb_in, tb_out); | ||
| 823 | *min_ts = av_rescale_q_rnd(*min_ts, tb_in, tb_out, | ||
| 824 | AV_ROUND_UP | AV_ROUND_PASS_MINMAX); | ||
| 825 | *max_ts = av_rescale_q_rnd(*max_ts, tb_in, tb_out, | ||
| 826 | AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX); | ||
| 827 | } | ||
| 828 | |||
| 829 | static int try_seek(AVFormatContext *avf, int stream, | 819 | static int try_seek(AVFormatContext *avf, int stream, |
| 830 | int64_t min_ts, int64_t ts, int64_t max_ts, int flags) | 820 | int64_t min_ts, int64_t ts, int64_t max_ts, int flags) |
| 831 | { | 821 | { |
| @@ -838,8 +828,8 @@ static int try_seek(AVFormatContext *avf, int stream, · 6 unmodified lines | |||
| 838 | if (stream >= 0) { | 828 | if (stream >= 0) { |
| 839 | if (stream >= cat->avf->nb_streams) | 829 | if (stream >= cat->avf->nb_streams) |
| 840 | return AVERROR(EIO); | 830 | return AVERROR(EIO); |
| 841 | rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base, | 831 | ff_rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base, |
| 842 | &min_ts, &ts, &max_ts); | 832 | &min_ts, &ts, &max_ts); |
| 843 | } | 833 | } |
| 844 | return avformat_seek_file(cat->avf, stream, min_ts, ts, max_ts, flags); | 834 | return avformat_seek_file(cat->avf, stream, min_ts, ts, max_ts, flags); |
| 845 | } | 835 | } |
| @@ -853,8 +843,8 @@ static int real_seek(AVFormatContext *avf, int stream, · 7 unmodified lines | |||
| 853 | if (stream >= 0) { | 843 | if (stream >= 0) { |
| 854 | if (stream >= avf->nb_streams) | 844 | if (stream >= avf->nb_streams) |
| 855 | return AVERROR(EINVAL); | 845 | return AVERROR(EINVAL); |
| 856 | rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q, | 846 | ff_rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q, |
| 857 | &min_ts, &ts, &max_ts); | 847 | &min_ts, &ts, &max_ts); |
| 858 | } | 848 | } |
| 859 | 849 | ||
| 860 | left = 0; | 850 | left = 0; |