diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-10-03 21:10:06 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-10-12 16:51:16 +0200 |
commit | 3b3ea34655db02d9cd9ea1a4122e920a7fdec602 (patch) | |
tree | 3b4c7cfd6d339a3357e2b9f22f3740917a387aff /libavformat | |
parent | 8c5dcaad13a54d90f25e8bbb54efe2a1afd5144e (diff) | |
download | ffmpeg-3b3ea34655db02d9cd9ea1a4122e920a7fdec602.tar.gz |
Remove all uses of deprecated AVOptions API.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/applehttp.c | 4 | ||||
-rw-r--r-- | libavformat/rtp.c | 6 | ||||
-rw-r--r-- | libavformat/rtpenc_chain.c | 13 |
3 files changed, 11 insertions, 12 deletions
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c index 10f58afde5..567baeb8ee 100644 --- a/libavformat/applehttp.c +++ b/libavformat/applehttp.c @@ -350,8 +350,8 @@ static int open_input(struct variant *var) snprintf(url, sizeof(url), "crypto:%s", seg->url); if ((ret = ffurl_alloc(&var->input, url, AVIO_FLAG_READ)) < 0) return ret; - av_set_string3(var->input->priv_data, "key", key, 0, NULL); - av_set_string3(var->input->priv_data, "iv", iv, 0, NULL); + av_opt_set(var->input->priv_data, "key", key, 0); + av_opt_set(var->input->priv_data, "iv", iv, 0); if ((ret = ffurl_connect(var->input)) < 0) { ffurl_close(var->input); var->input = NULL; diff --git a/libavformat/rtp.c b/libavformat/rtp.c index bb4bc17d3f..4be845a06c 100644 --- a/libavformat/rtp.c +++ b/libavformat/rtp.c @@ -97,9 +97,9 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec) /* Was the payload type already specified for the RTP muxer? */ if (ofmt && ofmt->priv_class) { - int payload_type = av_get_int(fmt->priv_data, "payload_type", NULL); - if (payload_type >= 0) - return payload_type; + int64_t payload_type; + if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0) + return (int)payload_type; } /* static payload type */ diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c index 0fb47f6234..dc8ed30c77 100644 --- a/libavformat/rtpenc_chain.c +++ b/libavformat/rtpenc_chain.c @@ -31,6 +31,8 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, AVFormatContext *rtpctx; int ret; AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); + uint8_t *rtpflags; + AVDictionary *opts = NULL; if (!rtp_format) return NULL; @@ -50,12 +52,8 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, /* Copy other stream parameters. */ rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio; - av_set_parameters(rtpctx, NULL); - /* Copy the rtpflags values straight through */ - if (s->oformat->priv_class && - av_find_opt(s->priv_data, "rtpflags", NULL, 0, 0)) - av_set_int(rtpctx->priv_data, "rtpflags", - av_get_int(s->priv_data, "rtpflags", NULL)); + if (av_opt_get(s, "rtpflags", AV_OPT_SEARCH_CHILDREN, &rtpflags) >= 0) + av_dict_set(&opts, "rtpflags", rtpflags, AV_DICT_DONT_STRDUP_VAL); /* Set the synchronized start time. */ rtpctx->start_time_realtime = s->start_time_realtime; @@ -66,7 +64,8 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, ffio_fdopen(&rtpctx->pb, handle); } else ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size); - ret = avformat_write_header(rtpctx, NULL); + ret = avformat_write_header(rtpctx, &opts); + av_dict_free(&opts); if (ret) { if (handle) { |