ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Fri May 17 15:32:05 2024 +0200| [26f3e79114660de079bc9d784070d70b64e18ee5] | 
committer: Andreas Rheinhardt

avformat/tee: Constify AVDictionaryEntry* pointee where possible

This is in preparation for using av_dict_iterate().

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

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

 libavformat/tee.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 1cbbb80dbb..b252b61a64 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -158,7 +158,7 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 {
     int i, ret;
     AVDictionary *options = NULL, *bsf_options = NULL;
-    AVDictionaryEntry *entry;
+    const AVDictionaryEntry *entry;
     char *filename;
     char *format = NULL, *select = NULL, *on_fail = NULL;
     char *use_fifo = NULL, *fifo_options_str = NULL;
@@ -172,15 +172,16 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
         return ret;
 
 #define CONSUME_OPTION(option, field, action) do {                      \
-        if ((entry = av_dict_get(options, option, NULL, 0))) {          \
-            field = entry->value;                                       \
+        AVDictionaryEntry *en = av_dict_get(options, option, NULL, 0);  \
+        if (en) {                                                       \
+            field = en->value;                                          \
             { action }                                                  \
             av_dict_set(&options, option, NULL, 0);                     \
         }                                                               \
     } while (0)
 #define STEAL_OPTION(option, field)                                     \
     CONSUME_OPTION(option, field,                                       \
-                   entry->value = NULL; /* prevent it from being freed */)
+                   en->value = NULL; /* prevent it from being freed */)
 #define PROCESS_OPTION(option, field, function, on_error)               \
     CONSUME_OPTION(option, field, if ((ret = function) < 0) { { on_error } 
goto end; })
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

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

Reply via email to