summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-02-02 10:38:58 +0100
committerAnton Khirnov <anton@khirnov.net>2016-02-14 22:33:26 +0100
commitc15f6098b1b25689dd5e86aeb5ce69bc12efe1e1 (patch)
tree163e1ad4e9243a475ec0b0f97c0938c4ef0fec16 /avconv.c
parent871d0930d4c8666df5514093beff874acbe5cce0 (diff)
avconv: pass the hw context from filters to the encoder
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 6b37d6e7d6..a84a345734 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1581,6 +1581,12 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
av_dict_set(&ost->encoder_opts, "threads", "auto", 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);