History

avformat/concat: refactor to use ff_rescale_interval()

Pierre-Anthony Lemieux committed 4 years ago

Commit 2a1eae21 parent f409c781 file · +4 −14Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/concatdec.c+4−14
@@ -816,16 +816,6 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt) · 815 unmodified lines
816816 return 0;
817817 }
818818
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−
829819 static int try_seek(AVFormatContext *avf, int stream,
830820 int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
831821 {
@@ -838,8 +828,8 @@ static int try_seek(AVFormatContext *avf, int stream, · 6 unmodified lines
838828 if (stream >= 0) {
839829 if (stream >= cat->avf->nb_streams)
840830 return AVERROR(EIO);
841− rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base,
842− &min_ts, &ts, &max_ts);
831+ ff_rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base,
832+ &min_ts, &ts, &max_ts);
843833 }
844834 return avformat_seek_file(cat->avf, stream, min_ts, ts, max_ts, flags);
845835 }
@@ -853,8 +843,8 @@ static int real_seek(AVFormatContext *avf, int stream, · 7 unmodified lines
853843 if (stream >= 0) {
854844 if (stream >= avf->nb_streams)
855845 return AVERROR(EINVAL);
856− rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q,
857− &min_ts, &ts, &max_ts);
846+ ff_rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q,
847+ &min_ts, &ts, &max_ts);
858848 }
859849
860850 left = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t