avconv: pass the hwaccel frames context to the decoder
authorAnton Khirnov <anton@khirnov.net>
Fri, 27 May 2016 10:54:48 +0000 (12:54 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sat, 25 Jun 2016 10:10:42 +0000 (12:10 +0200)
avconv.c

index 65eabbd..4eae015 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -1616,6 +1616,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;