[libav-devel] [PATCH 3/3] hls: Don't persist http options that haven't been set

Martin Storsjö martin at martin.st
Tue Dec 8 08:42:13 CET 2015


By default, av_opt_get returns the empty string for options that
aren't set.

This avoids warnings about "No trailing CRLF found in HTTP header."
---
 libavformat/hls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index dc3ab87..ab08365 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -497,7 +497,7 @@ static int save_avio_options(AVFormatContext *s)
     int ret = 0;
 
     while (*opt) {
-        if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) {
+        if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN | AV_OPT_ALLOW_NULL, &buf) >= 0) {
             ret = av_dict_set(&c->avio_opts, *opt, buf,
                               AV_DICT_DONT_STRDUP_VAL);
             if (ret < 0)
-- 
2.4.9 (Apple Git-60)



More information about the libav-devel mailing list