]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1'
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 24 Feb 2016 17:08:03 +0000 (17:08 +0000)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 24 Feb 2016 17:08:13 +0000 (17:08 +0000)
* commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1':
  avconv: pass the hw context from filters to the encoder

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
ffmpeg.c

index 32f7bd26b7e0ce22fcc902b4a6f6263633fbc4fb..9bbe5c375918229242f53048e942154e88104d0d 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2607,6 +2607,12 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
             !av_dict_get(ost->encoder_opts, "ab", NULL, 0))
             av_dict_set(&ost->encoder_opts, "b", "128000", 0);
 
+        if (ost->filter && ost->filter->filter->inputs[0]->hw_frames_ctx) {
+            ost->enc_ctx->hw_frames_ctx = av_buffer_ref(ost->filter->filter->inputs[0]->hw_frames_ctx);
+            if (!ost->enc_ctx->hw_frames_ctx)
+                return AVERROR(ENOMEM);
+        }
+
         if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
             if (ret == AVERROR_EXPERIMENTAL)
                 abort_codec_experimental(codec, 1);