set duration to max(tmp, duration) in a proper time base and return duration's time_base
| 4096 | |
| 4097 | // set duration to max(tmp, duration) in a proper time base and return duration's time_base |
| 4098 | static AVRational duration_max(int64_t tmp, int64_t *duration, AVRational tmp_time_base, |
| 4099 | AVRational time_base) |
| 4100 | { |
| 4101 | int ret; |
| 4102 | |
| 4103 | if (!*duration) { |
| 4104 | *duration = tmp; |
| 4105 | return tmp_time_base; |
| 4106 | } |
| 4107 | |
| 4108 | ret = av_compare_ts(*duration, time_base, tmp, tmp_time_base); |
| 4109 | if (ret < 0) { |
| 4110 | *duration = tmp; |
| 4111 | return tmp_time_base; |
| 4112 | } |
| 4113 | |
| 4114 | return time_base; |
| 4115 | } |
| 4116 | |
| 4117 | static int seek_to_start(InputFile *ifile, AVFormatContext *is) |
| 4118 | { |