X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=ffmpeg.c;fp=ffmpeg.c;h=1a0e909fb0037da7815361938a7bdeb0afe3970d;hb=b5e1ec5660692d7cee360da3ed0434d3b46f40d5;hp=41c709d6813a7657d9e65d75ae2d9052c8b30efd;hpb=78e871ebbcc6f3c877e7292c4dda0c9979f8ede4;p=android-x86%2Fexternal-ffmpeg.git diff --git a/ffmpeg.c b/ffmpeg.c index 41c709d681..1a0e909fb0 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -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);