- memset(ap, 0, sizeof(*ap));
-
- ap->prealloced_context = 1;
- ap->width = frame_width;
- ap->height= frame_height;
- ap->time_base= (AVRational){1, 25};
- ap->pix_fmt = frame_pix_fmt;
- ic->flags |= AVFMT_FLAG_PRIV_OPT;
-
-
- 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;
- }
- }
+ err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);