[FFmpeg-cvslog] ffmpeg_filter: fix hwaccel transcoding

Hendrik Leppkes git at videolan.org
Sun Nov 13 18:21:50 EET 2016


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Fri Nov 11 14:47:49 2016 +0100| [ca7cdffb70c5fcf04c442c53600c3beb1ba01417] | committer: Hendrik Leppkes

ffmpeg_filter: fix hwaccel transcoding

Based on a patch by Yogender Gupta <ygupta at nvidia.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca7cdffb70c5fcf04c442c53600c3beb1ba01417
---

 ffmpeg_filter.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 2a9be64..a54d1f2 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -1142,8 +1142,9 @@ int ifilter_parameters_from_decoder(InputFilter *ifilter, const AVCodecContext *
     ifilter->channels            = avctx->channels;
     ifilter->channel_layout      = avctx->channel_layout;
 
-    if (avctx->hw_frames_ctx) {
-        ifilter->hw_frames_ctx = av_buffer_ref(avctx->hw_frames_ctx);
+    if (ifilter->ist && ifilter->ist->hw_frames_ctx) {
+        ifilter->format = ifilter->ist->resample_pix_fmt;
+        ifilter->hw_frames_ctx = av_buffer_ref(ifilter->ist->hw_frames_ctx);
         if (!ifilter->hw_frames_ctx)
             return AVERROR(ENOMEM);
     }



More information about the ffmpeg-cvslog mailing list