* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
+#include "avio_internal.h"
#include "libavutil/opt.h"
/**
((s->iformat && s->iformat->priv_class) ||
s->oformat && s->oformat->priv_class))
return s->priv_data;
+#if !FF_API_OLD_AVIO
+ if (s->pb && s->pb->av_class && prev != s->pb)
+ return s->pb;
+#endif
return NULL;
}
while (prev && (ofmt = av_oformat_next(ofmt)))
if (ofmt->priv_class == prev)
break;
- while (ofmt = av_oformat_next(ofmt))
- if (ofmt->priv_class)
- return ofmt->priv_class;
+ if ((prev && ofmt) || (!prev))
+ while (ofmt = av_oformat_next(ofmt))
+ if (ofmt->priv_class)
+ return ofmt->priv_class;
+
+#if !FF_API_OLD_AVIO
+ if (prev != &ffio_url_class)
+ return &ffio_url_class;
+#endif
return NULL;
}
#endif
/* open input file and probe the format if necessary */
-static int init_input(AVFormatContext *s, const char *filename)
+static int init_input(AVFormatContext *s, const char *filename, AVDictionary **options)
{
int ret;
AVProbeData pd = {filename, NULL, 0};
return 0;
if ((ret = avio_open2(&s->pb, filename, AVIO_FLAG_READ,
- &s->interrupt_callback, NULL)) < 0)
+ &s->interrupt_callback, options)) < 0)
return ret;
if (s->iformat)
return 0;
if ((ret = av_opt_set_dict(s, &tmp)) < 0)
goto fail;
- if ((ret = init_input(s, filename)) < 0)
+ if ((ret = init_input(s, filename, &tmp)) < 0)
goto fail;
/* check filename in case an image number is expected */