From bfbf86ef18f756c4e27ab569309ef8bc7a5531ac Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 29 Sep 2016 10:29:10 +0200 Subject: [PATCH] ffmpeg: pass the hwaccel frames context to the decoder --- ffmpeg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ffmpeg.c b/ffmpeg.c index d0f247ec68..9a8e65a1e3 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2547,6 +2547,13 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat } continue; } + + if (ist->hw_frames_ctx) { + s->hw_frames_ctx = av_buffer_ref(ist->hw_frames_ctx); + if (!s->hw_frames_ctx) + return AV_PIX_FMT_NONE; + } + ist->active_hwaccel_id = hwaccel->id; ist->hwaccel_pix_fmt = *p; break;