[1/4] libavformat: Set options on demuxer AVFormatContexts after initializing the input

Message ID 1332153486-73460-1-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö March 19, 2012, 10:38 a.m.
This is in preparation for adding support for demuxer specific
defaults, where the input format needs to be known before setting
the defaults, which should be done before applying the user provided
options.

This can potentially change the behaviour in cases where an option
with the same name exists both in the demuxer and in the protocol.
---
 libavformat/utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index c91a0dc..4ecf053 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -530,10 +530,10 @@  int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
     if (options)
         av_dict_copy(&tmp, *options, 0);
 
-    if ((ret = av_opt_set_dict(s, &tmp)) < 0)
+    if ((ret = init_input(s, filename, &tmp)) < 0)
         goto fail;
 
-    if ((ret = init_input(s, filename, &tmp)) < 0)
+    if ((ret = av_opt_set_dict(s, &tmp)) < 0)
         goto fail;
 
     /* check filename in case an image number is expected */