Browse code

Merge commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1'

* commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1':
avconv: pass the hw context from filters to the encoder

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

Derek Buitenhuis authored on 2016/02/25 02:08:03
Showing 1 changed files
... ...
@@ -2607,6 +2607,12 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
2607 2607
             !av_dict_get(ost->encoder_opts, "ab", NULL, 0))
2608 2608
             av_dict_set(&ost->encoder_opts, "b", "128000", 0);
2609 2609
 
2610
+        if (ost->filter && ost->filter->filter->inputs[0]->hw_frames_ctx) {
2611
+            ost->enc_ctx->hw_frames_ctx = av_buffer_ref(ost->filter->filter->inputs[0]->hw_frames_ctx);
2612
+            if (!ost->enc_ctx->hw_frames_ctx)
2613
+                return AVERROR(ENOMEM);
2614
+        }
2615
+
2610 2616
         if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
2611 2617
             if (ret == AVERROR_EXPERIMENTAL)
2612 2618
                 abort_codec_experimental(codec, 1);