diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-05-25 16:59:51 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-07-13 23:17:42 +0200 |
commit | 3009f521f390b2bd440d9747a9c6baf648b2087a (patch) | |
tree | e4bb7ff1c0a7f595b1e29a0b6bc92fd2bb91b086 /cmdutils.c | |
parent | 8c8eab8bfed74cceb4a04f982f349c7c17f5eb6f (diff) | |
download | ffmpeg-3009f521f390b2bd440d9747a9c6baf648b2087a.tar.gz |
ffplay: use new avcodec_open2 and avformat_find_stream_info API.
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index a2fe103f9b..b375378af9 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -912,6 +912,23 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, int e return ret; } +AVDictionary **setup_find_stream_info_opts(AVFormatContext *s) +{ + int i; + AVDictionary **opts; + + if (!s->nb_streams) + return NULL; + opts = av_mallocz(s->nb_streams * sizeof(*opts)); + if (!opts) { + av_log(NULL, AV_LOG_ERROR, "Could not alloc memory for stream options.\n"); + return NULL; + } + for (i = 0; i < s->nb_streams; i++) + opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codec->codec_id, 0); + return opts; +} + #if CONFIG_AVFILTER static int ffsink_init(AVFilterContext *ctx, const char *args, void *opaque) |