- av_metadata_set2(&c->fmt_ctx.metadata, "author" , c->stream->author , 0);
- av_metadata_set2(&c->fmt_ctx.metadata, "comment" , c->stream->comment , 0);
- av_metadata_set2(&c->fmt_ctx.metadata, "copyright", c->stream->copyright, 0);
- av_metadata_set2(&c->fmt_ctx.metadata, "title" , c->stream->title , 0);
+ av_dict_set(&c->fmt_ctx.metadata, "author" , c->stream->author , 0);
+ av_dict_set(&c->fmt_ctx.metadata, "comment" , c->stream->comment , 0);
+ av_dict_set(&c->fmt_ctx.metadata, "copyright", c->stream->copyright, 0);
+ av_dict_set(&c->fmt_ctx.metadata, "title" , c->stream->title , 0);
+
+ c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * c->stream->nb_streams);