On 06/18/2011 08:52 AM, Anton Khirnov wrote:
> +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));
> + for (i = 0; i < s->nb_streams; i++) {
> + AVCodecContext *dec = s->streams[i]->codec;
> + switch (dec->codec_type) {
> + case AVMEDIA_TYPE_AUDIO: av_dict_copy(&opts[i], audio_opts, 0);
> break;
> + case AVMEDIA_TYPE_VIDEO: av_dict_copy(&opts[i], video_opts, 0);
> break;
> + case AVMEDIA_TYPE_SUBTITLE: av_dict_copy(&opts[i], sub_opts, 0);
> break;
> + }
> + }
> + return opts;
> +}
Maybe this should print an error message if opts is NULL due to
allocation failure.
-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel