OSDN Git Service

ffplay: demuxer specific options support
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 1 May 2011 14:59:47 +0000 (16:59 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 2 May 2011 00:58:09 +0000 (02:58 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffplay.c

index 945e08f..40fad52 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2381,10 +2381,18 @@ static int read_thread(void *arg)
     ap->height= frame_height;
     ap->time_base= (AVRational){1, 25};
     ap->pix_fmt = frame_pix_fmt;
+    ic->flags |= AVFMT_FLAG_PRIV_OPT;
 
-    set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL);
 
     err = av_open_input_file(&ic, is->filename, is->iformat, 0, ap);
+    if (err >= 0) {
+        set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL);
+        err = av_demuxer_open(ic, ap);
+        if(err < 0){
+            avformat_free_context(ic);
+            ic= NULL;
+        }
+    }
     if (err < 0) {
         print_error(is->filename, err);
         ret = -1;