X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foptions.c;h=dccb6faa730c11b976ce4df2d06bac8bf71a5cdc;hb=0bf3a7361d17d596a5044882098f56817db0e103;hp=8d7c4fe4cb301c34e471ebdc458ad10cd4e1604d;hpb=9066969713e6a7bad0b76f1936ee60cac456bbe0;p=ffmpeg diff --git a/libavformat/options.c b/libavformat/options.c index 8d7c4fe4cb3..dccb6faa730 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -54,41 +54,6 @@ static void *format_child_next(void *obj, void *prev) return NULL; } -#if FF_API_CHILD_CLASS_NEXT -static const AVClass *format_child_class_next(const AVClass *prev) -{ - const AVInputFormat *ifmt = NULL; - const AVOutputFormat *ofmt = NULL; - void *ifmt_iter = NULL, *ofmt_iter = NULL; - - if (!prev) - return &ff_avio_class; - - while ((ifmt = av_demuxer_iterate(&ifmt_iter))) - if (ifmt->priv_class == prev) - break; - - if (!ifmt) { - ifmt_iter = NULL; - while ((ofmt = av_muxer_iterate(&ofmt_iter))) - if (ofmt->priv_class == prev) - break; - } - if (!ofmt) { - ofmt_iter = NULL; - while ((ifmt = av_demuxer_iterate(&ifmt_iter))) - if (ifmt->priv_class) - return ifmt->priv_class; - } - - while ((ofmt = av_muxer_iterate(&ofmt_iter))) - if (ofmt->priv_class) - return ofmt->priv_class; - - return NULL; -} -#endif - enum { CHILD_CLASS_ITER_AVIO = 0, CHILD_CLASS_ITER_MUX, @@ -158,9 +123,6 @@ static const AVClass av_format_context_class = { .option = avformat_options, .version = LIBAVUTIL_VERSION_INT, .child_next = format_child_next, -#if FF_API_CHILD_CLASS_NEXT - .child_class_next = format_child_class_next, -#endif .child_class_iterate = format_child_class_iterate, .category = AV_CLASS_CATEGORY_MUXER, .get_category = get_category, @@ -181,13 +143,6 @@ static int io_open_default(AVFormatContext *s, AVIOContext **pb, av_log(s, loglevel, "Opening \'%s\' for %s\n", url, flags & AVIO_FLAG_WRITE ? "writing" : "reading"); -#if FF_API_OLD_OPEN_CALLBACKS -FF_DISABLE_DEPRECATION_WARNINGS - if (s->open_cb) - return s->open_cb(s, pb, url, flags, &s->interrupt_callback, options); -FF_ENABLE_DEPRECATION_WARNINGS -#endif - return ffio_open_whitelist(pb, url, flags, &s->interrupt_callback, options, s->protocol_whitelist, s->protocol_blacklist); } @@ -221,7 +176,10 @@ AVFormatContext *avformat_alloc_context(void) return NULL; } internal->pkt = av_packet_alloc(); - if (!internal->pkt) { + internal->parse_pkt = av_packet_alloc(); + if (!internal->pkt || !internal->parse_pkt) { + av_packet_free(&internal->pkt); + av_packet_free(&internal->parse_pkt); av_free(internal); av_free(ic); return NULL;