[FFmpeg-cvslog] lavfi/vf_libplacebo: keep track of latest status globally

Niklas Haas git at videolan.org
Tue Jun 20 18:11:30 EEST 2023


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Thu Jun 15 15:54:31 2023 +0200| [0c66d912ba2248a3650fb1ed8563adf28bff2987] | committer: Niklas Haas

lavfi/vf_libplacebo: keep track of latest status globally

This field will effectively hold the most recent status set by any
input. Currently functionally equivalent to input->status, but will
change soon.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c66d912ba2248a3650fb1ed8563adf28bff2987
---

 libavfilter/vf_libplacebo.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index ee8780036c..5b45d4f8fb 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -138,6 +138,8 @@ typedef struct LibplaceboContext {
     /* input state */
     LibplaceboInput *inputs;
     int nb_inputs;
+    int64_t status_pts; ///< tracks status of most recently used input
+    int status;
 
     /* settings */
     char *out_format_string;
@@ -943,6 +945,11 @@ static int handle_input(AVFilterContext *ctx, LibplaceboInput *input)
         pl_queue_push(input->queue, NULL); /* Signal EOF to pl_queue */
         input->status = status;
         input->status_pts = pts;
+        if (!s->status || pts >= s->status_pts) {
+            /* Also propagate to output unless overwritten by later status change */
+            s->status = status;
+            s->status_pts = pts;
+        }
     }
 
     return 0;
@@ -975,8 +982,8 @@ static int libplacebo_activate(AVFilterContext *ctx)
             }
         }
 
-        if (in->status && pts >= in->status_pts) {
-            ff_outlink_set_status(outlink, in->status, in->status_pts);
+        if (s->status && pts >= s->status_pts) {
+            ff_outlink_set_status(outlink, s->status, s->status_pts);
             return 0;
         }
 



More information about the ffmpeg-cvslog mailing list