avconv: fix handling attachments in init_output_stream
authorAnton Khirnov <anton@khirnov.net>
Mon, 23 May 2016 07:59:35 +0000 (09:59 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 21 Jun 2016 10:39:02 +0000 (12:39 +0200)
The current code assumes that encoding_needed is simply an inverse of
stream_copy, which is not true for manually attached files (for which
neither of those is true).

avconv.c

index e5a76b1..4f8d688 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -1734,7 +1734,7 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
         }
 
         ost->st->time_base = ost->enc_ctx->time_base;
-    } else {
+    } else if (ost->stream_copy) {
         ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
         if (ret < 0)
             return ret;