diff options
author | Matthieu Bouron <matthieu.bouron@gmail.com> | 2017-03-29 23:39:40 +0200 |
---|---|---|
committer | Matthieu Bouron <matthieu.bouron@gmail.com> | 2017-03-30 00:02:08 +0200 |
commit | b5e1ec5660692d7cee360da3ed0434d3b46f40d5 (patch) | |
tree | 853ecad2f21623a52a15577dca710c337823a6c6 /ffmpeg.c | |
parent | 78e871ebbcc6f3c877e7292c4dda0c9979f8ede4 (diff) | |
parent | e3fb74f7f9a8f1895381355f40c92cac3c1023d9 (diff) |
Merge commit 'e3fb74f7f9a8f1895381355f40c92cac3c1023d9'
* commit 'e3fb74f7f9a8f1895381355f40c92cac3c1023d9':
lavfi: Always propagate hw_frames_ctx through links
Merged-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -47,6 +47,7 @@ #include "libavutil/parseutils.h" #include "libavutil/samplefmt.h" #include "libavutil/fifo.h" +#include "libavutil/hwcontext.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/dict.h" @@ -3421,7 +3422,9 @@ 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 && av_buffersink_get_hw_frames_ctx(ost->filter->filter)) { + if (ost->filter && av_buffersink_get_hw_frames_ctx(ost->filter->filter) && + ((AVHWFramesContext*)av_buffersink_get_hw_frames_ctx(ost->filter->filter)->data)->format == + av_buffersink_get_format(ost->filter->filter)) { ost->enc_ctx->hw_frames_ctx = av_buffer_ref(av_buffersink_get_hw_frames_ctx(ost->filter->filter)); if (!ost->enc_ctx->hw_frames_ctx) return AVERROR(ENOMEM); |