This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 5f2a38d11ce2e074daef320c5357afcdd2b9e8ff
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Oct 8 12:14:36 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Oct 20 21:33:01 2026 +0000

    swscale/ops: add link back to owning SwsOpList
    
    This makes some helper functions more convenient to implement in a way 
that's
    less dependent on SwsOpList design decisions, and without requiring 
threading
    that parameter through every function.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops.c |  5 ++++-
 libswscale/ops.h | 10 ++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/libswscale/ops.c b/libswscale/ops.c
index 07159b57d8..1100ce59ba 100644
--- a/libswscale/ops.c
+++ b/libswscale/ops.c
@@ -702,7 +702,9 @@ SwsOpList *ff_sws_op_list_duplicate(const SwsOpList *ops)
     }
 
     for (int i = 0; i < copy->num_ops; i++) {
-        const SwsOp *op = &copy->ops[i];
+        SwsOp *op = &copy->ops[i];
+        op->ops = copy;
+
         switch (op->op) {
         case SWS_OP_READ:
             if (op->rw.filter.kernel)
@@ -764,6 +766,7 @@ int ff_sws_op_list_insert_at(SwsOpList *ops, int index, 
SwsOp *op)
     for (int i = ops->num_ops - 1; i > index; i--)
         ops->ops[i] = ops->ops[i - 1];
     ops->ops[index] = *op;
+    ops->ops[index].ops = ops;
     return 0;
 }
 
diff --git a/libswscale/ops.h b/libswscale/ops.h
index 2045630022..5a74434c9f 100644
--- a/libswscale/ops.h
+++ b/libswscale/ops.h
@@ -238,7 +238,10 @@ typedef struct SwsOpPad {
     SwsCompMask dep_in, dep_out;
 } SwsOpPad;
 
-typedef struct SwsOp {
+typedef struct SwsOp     SwsOp;
+typedef struct SwsOpList SwsOpList;
+
+struct SwsOp {
     SwsOpType op;      /* operation to perform */
     SwsPixelType type; /* pixel type to operate on */
     union {
@@ -264,7 +267,10 @@ typedef struct SwsOp {
      * metadata for all operations, during ff_sws_ops_compile().
      */
     SwsOpPad outputs[4];
-} SwsOp;
+
+    /* Link back to the SwsOpList that owns this operation */
+    SwsOpList *ops;
+};
 
 #define SWS_OP_NEEDED(op, idx) (!((op)->outputs[idx].flags & SWS_COMP_GARBAGE))
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to