This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new ee2eb6ced8 fftools/ffmpeg_filter: fix access private API of libavcodec
ee2eb6ced8 is described below
commit ee2eb6ced80f6799f348f56803e939b0f1e0f3b8
Author: Zhao Zhili <[email protected]>
AuthorDate: Mon Dec 29 07:25:49 2025 +0000
Commit: Zhao Zhili <[email protected]>
CommitDate: Tue Dec 30 07:40:15 2025 +0000
fftools/ffmpeg_filter: fix access private API of libavcodec
Firstly, mathops.h is a private header of libavcodec and should not be used
in fftools. It may reference libavcodec internal symbols, causing link
error with dynamic library, e.g.,
fftools/ffmpeg_filter.c:2687: undefined reference to `ff_rv_zbb_supported'
Secondly, mid_pred operates on int types, while current use case is
int64_t.
---
fftools/ffmpeg_filter.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index d5ae59ec03..4387c992da 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -40,9 +40,6 @@
#include "libavutil/time.h"
#include "libavutil/timestamp.h"
-// FIXME private header, used for mid_pred()
-#include "libavcodec/mathops.h"
-
typedef struct FilterGraphPriv {
FilterGraph fg;
@@ -2489,6 +2486,23 @@ early_exit:
return float_pts;
}
+static int64_t median3(int64_t a, int64_t b, int64_t c)
+{
+ int64_t max2, min2, m;
+
+ if (a >= b) {
+ max2 = a;
+ min2 = b;
+ } else {
+ max2 = b;
+ min2 = a;
+ }
+ m = (c >= max2) ? max2 : c;
+
+ return (m >= min2) ? m : min2;
+}
+
+
/* Convert frame timestamps to the encoder timebase and decide how many times
* should this (and possibly previous) frame be repeated in order to conform to
* desired target framerate (if any).
@@ -2501,9 +2515,9 @@ static void video_sync_process(OutputFilterPriv *ofp,
AVFrame *frame,
double delta0, delta, sync_ipts, duration;
if (!frame) {
- *nb_frames_prev = *nb_frames = mid_pred(fps->frames_prev_hist[0],
- fps->frames_prev_hist[1],
- fps->frames_prev_hist[2]);
+ *nb_frames_prev = *nb_frames = median3(fps->frames_prev_hist[0],
+ fps->frames_prev_hist[1],
+ fps->frames_prev_hist[2]);
if (!*nb_frames && fps->last_dropped) {
atomic_fetch_add(&ofilter->nb_frames_drop, 1);
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]