[FFmpeg-cvslog] avutil/test/opt: test the AV_OPT_SERIALIZE_SKIP_DEFAULTS flag

James Almer git at videolan.org
Wed Apr 24 05:56:03 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Apr 12 19:51:13 2024 -0300| [a9df9f95c43992d60c99cbd2f6bd28a104ed5d0b] | committer: James Almer

avutil/test/opt: test the AV_OPT_SERIALIZE_SKIP_DEFAULTS flag

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavutil/tests/opt.c | 5 +++++
 tests/ref/fate/opt    | 1 +
 2 files changed, 6 insertions(+)

diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c
index ccf3a54f96..32301ba842 100644
--- a/libavutil/tests/opt.c
+++ b/libavutil/tests/opt.c
@@ -279,6 +279,11 @@ int main(void)
             if (av_opt_serialize(&test_ctx, 0, 0, &buf, '=', ',') >= 0) {
                 printf("%s\n", buf);
                 av_free(buf);
+                if (av_opt_serialize(&test_ctx, 0, AV_OPT_SERIALIZE_SKIP_DEFAULTS, &buf, '=', ',') >= 0) {
+                    if (strlen(buf))
+                        printf("%s\n", buf);
+                    av_free(buf);
+                }
             }
         }
         av_opt_free(&test_ctx);
diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt
index f4fce1bd49..43bf0929a3 100644
--- a/tests/ref/fate/opt
+++ b/tests/ref/fate/opt
@@ -179,6 +179,7 @@ Setting entry with key 'array_int' to value ''
 Setting entry with key 'array_str' to value 'str0|str\|1|str\\2'
 Setting entry with key 'array_dict' to value 'k00=v\\\\00:k01=v\,01,k10=v\\=1\\:0'
 num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=hexagonal,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false,dict1=,dict2=happy\=\\:-),array_int=,array_str=str0|str\\|1|str\\\\2,array_dict=k00\=v\\\\\\\\00:k01\=v\\\,01\,k10\=v\\\\\=1\\\\:0
+flt=0.333333,dbl=0.333333,array_int=
 
 Testing av_set_options_string()
 Setting options string ''



More information about the ffmpeg-cvslog mailing list