Re: [FFmpeg-devel] [PATCH v3 7/7] avformat/concat: refactor to use ff_rescale_interval()

2022-03-08 Thread Nicolas George
p...@sandflow.com (12022-03-07):
> From: Pierre-Anthony Lemieux 
> 
> ---
>  libavformat/concatdec.c | 18 --
>  1 file changed, 4 insertions(+), 14 deletions(-)

This patch still LGTM.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 7/7] avformat/concat: refactor to use ff_rescale_interval()

2022-03-07 Thread pal
From: Pierre-Anthony Lemieux 

---
 libavformat/concatdec.c | 18 --
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 0603c6e254..cfe1329105 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -816,16 +816,6 @@ static int concat_read_packet(AVFormatContext *avf, 
AVPacket *pkt)
 return 0;
 }
 
-static void rescale_interval(AVRational tb_in, AVRational tb_out,
- int64_t *min_ts, int64_t *ts, int64_t *max_ts)
-{
-*ts = av_rescale_q(*ts, tb_in, tb_out);
-*min_ts = av_rescale_q_rnd(*min_ts, tb_in, tb_out,
-   AV_ROUND_UP   | AV_ROUND_PASS_MINMAX);
-*max_ts = av_rescale_q_rnd(*max_ts, tb_in, tb_out,
-   AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX);
-}
-
 static int try_seek(AVFormatContext *avf, int stream,
 int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 {
@@ -838,8 +828,8 @@ static int try_seek(AVFormatContext *avf, int stream,
 if (stream >= 0) {
 if (stream >= cat->avf->nb_streams)
 return AVERROR(EIO);
-rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base,
- &min_ts, &ts, &max_ts);
+ff_rescale_interval(AV_TIME_BASE_Q, 
cat->avf->streams[stream]->time_base,
+&min_ts, &ts, &max_ts);
 }
 return avformat_seek_file(cat->avf, stream, min_ts, ts, max_ts, flags);
 }
@@ -853,8 +843,8 @@ static int real_seek(AVFormatContext *avf, int stream,
 if (stream >= 0) {
 if (stream >= avf->nb_streams)
 return AVERROR(EINVAL);
-rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q,
- &min_ts, &ts, &max_ts);
+ff_rescale_interval(avf->streams[stream]->time_base, AV_TIME_BASE_Q,
+&min_ts, &ts, &max_ts);
 }
 
 left  = 0;
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".