diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-24 20:08:03 +0300 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-24 20:08:13 +0300 |
commit | 259fef86bb91784f31a7e43e0d6d6a2a1d86f41c (patch) | |
tree | 7cdea83a0a7d2902ecb6d5fe29c5b22c8062016f /ffmpeg.c | |
parent | e05704bd46b9107af25204dff47bd8b034868ae4 (diff) | |
parent | c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1 (diff) |
Merge commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1'
* commit 'c15f6098b1b25689dd5e86aeb5ce69bc12efe1e1':
avconv: pass the hw context from filters to the encoder
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |