diff options
Diffstat (limited to 'libavformat/options.c')
-rw-r--r-- | libavformat/options.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libavformat/options.c b/libavformat/options.c index 64bc7a8996..4afb8b52bc 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avformat.h" +#include "avio_internal.h" #include "libavutil/opt.h" /** @@ -40,6 +41,10 @@ static void *format_child_next(void *obj, void *prev) ((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; } @@ -49,19 +54,29 @@ static const AVClass *format_child_class_next(const AVClass *prev) AVOutputFormat *ofmt = NULL; while (prev && (ifmt = av_iformat_next(ifmt))) - if (ifmt->priv_class == prev) + if (ifmt->priv_class == prev){ + prev = NULL; break; - if ((prev && ifmt) || (!prev)) + } + if (!prev) while (ifmt = av_iformat_next(ifmt)) if (ifmt->priv_class) return ifmt->priv_class; while (prev && (ofmt = av_oformat_next(ofmt))) - if (ofmt->priv_class == prev) + if (ofmt->priv_class == prev){ + prev = NULL; break; - while (ofmt = av_oformat_next(ofmt)) - if (ofmt->priv_class) - return ofmt->priv_class; + } + if (!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; } |