PR #20710 opened by Artem Smorodin (artem.smorodin.dacast)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20710
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20710.patch

I found that the default value is not set for `onfail` option.

I see that there is an attempt to set this value by default inside 
`parse_slave_failure_policy_option`. But look at the `CONSUME_OPTION` macro. If 
`av_dict_get` cannot find this option, then this function is not even called. I 
mean `if (en) { `


>From 293a527ada263a9e42cbd0957c362e40b594f1e2 Mon Sep 17 00:00:00 2001
From: Artem Smmorodin <[email protected]>
Date: Wed, 15 Oct 2025 22:38:57 +0300
Subject: [PATCH] Fixing the default option setting

---
 libavformat/tee.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 0bac4fa202..d1dd4e424e 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -152,6 +152,11 @@ static void close_slaves(AVFormatContext *avf)
     av_freep(&tee->slaves);
 }
 
+static void set_slave_defaults(TeeSlave *tee_slave)
+{
+    tee_slave->on_fail = DEFAULT_SLAVE_FAILURE_POLICY;
+}
+
 static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
 {
     int ret;
@@ -167,6 +172,8 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
     if ((ret = ff_tee_parse_slave_options(avf, slave, &options, &filename)) < 
0)
         return ret;
 
+    set_slave_defaults(tee_slave);
+
 #define CONSUME_OPTION(option, field, action) do {                      \
         AVDictionaryEntry *en = av_dict_get(options, option, NULL, 0);  \
         if (en) {                                                       \
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to