[FFmpeg-devel] [PATCH] lavu/opt: make av_opt_get() return NULL in case a string is not set
Stefano Sabatini
stefasab at gmail.com
Mon Mar 4 18:43:12 CET 2013
This allows to distinguish between the case when the string is not set,
and the string is set to the empty string.
TODO: bump micro
---
libavutil/opt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 61c76da..5f27cf1 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -549,7 +549,7 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
if (*(uint8_t**)dst)
*out_val = av_strdup(*(uint8_t**)dst);
else
- *out_val = av_strdup("");
+ *out_val = NULL;
return 0;
case AV_OPT_TYPE_BINARY:
len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));
--
1.7.9.5
More information about the ffmpeg-devel
mailing list