Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] avutil/test/opt: test the AV_OPT_SERIALIZE_SKIP_DEFAULTS flag
@ 2024-04-12 23:16 James Almer
  2024-04-12 23:16 ` [FFmpeg-devel] [PATCH 2/2] avutil/opt: add support for children objects in av_opt_serialize James Almer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: James Almer @ 2024-04-12 23:16 UTC (permalink / raw)
  To: ffmpeg-devel

Signed-off-by: James Almer <jamrial@gmail.com>
---
The floats are set to "1.0 / 3" and the serialization prints a value that's not
exact, hence them not being skipped.
array_int is weird, though. Although it's the only array that doesn't set
AVOption.arr

 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 ''
-- 
2.44.0

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-23 19:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12 23:16 [FFmpeg-devel] [PATCH 1/2] avutil/test/opt: test the AV_OPT_SERIALIZE_SKIP_DEFAULTS flag James Almer
2024-04-12 23:16 ` [FFmpeg-devel] [PATCH 2/2] avutil/opt: add support for children objects in av_opt_serialize James Almer
2024-04-15 12:51   ` James Almer
2024-04-23 19:09     ` James Almer
2024-04-13 14:21 ` [FFmpeg-devel] [PATCH 3/3] avutil/tests/opt: test av_opt_find2() James Almer
2024-04-15 15:09 ` [FFmpeg-devel] [PATCH 4/4] fftools/ffmpeg_mux_init: allow mapping a stream group from one of the inputs James Almer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git