From 4a05d2eda7215fcadbebec8f4656bbb71574567e Mon Sep 17 00:00:00 2001 From: James Almer Date: Tue, 27 Sep 2016 10:10:44 -0300 Subject: ffmpeg: stop using AVStream.codec on stream copy This commit is based on commit 35c8580 from Anton Khirnov which was skipped in b8945c4. The avcodec_copy_context() call in the encode path is left in place for now as AVStream.codec is apparently still required even after porting ffmpeg to the new bsf API. Tested-by: Michael Niedermayer Signed-off-by: James Almer --- ffmpeg_opt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ffmpeg_opt.c') diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 73da5463d1..d202f4396c 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -2300,6 +2300,7 @@ loop_end: avio_read(pb, attachment, len); ost = new_attachment_stream(o, oc, -1); + ost->stream_copy = 0; ost->attachment_filename = o->attachments[i]; ost->st->codecpar->extradata = attachment; ost->st->codecpar->extradata_size = len; @@ -2309,6 +2310,7 @@ loop_end: avio_closep(&pb); } +#if FF_API_LAVF_AVCTX for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) { //for all streams of this output file AVDictionaryEntry *e; ost = output_streams[i]; @@ -2319,6 +2321,7 @@ loop_end: if (av_opt_set(ost->st->codec, "flags", e->value, 0) < 0) exit_program(1); } +#endif if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) { av_dump_format(oc, nb_output_files - 1, oc->filename, 1); -- cgit v1.2.3