]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg_cuvid.c
doc/encoders: fix broken build with 884506dfe2e
[ffmpeg] / ffmpeg_cuvid.c
index bd2d97517f9555f81cf43018dbeb10b61f6368e4..baf6eee9f8c46821900783fd686bf3fb8bc70508 100644 (file)
@@ -129,13 +129,13 @@ int cuvid_transcode_init(OutputStream *ost)
         ist->hwaccel_uninit = cuvid_uninit;
 
         /* This is a bit hacky, av_hwframe_ctx_init is called by the cuvid decoder
-         * once it has probed the neccesary format information. But as filters/nvenc
+         * once it has probed the necessary format information. But as filters/nvenc
          * need to know the format/sw_format, set them here so they are happy.
          * This is fine as long as CUVID doesn't add another supported pix_fmt.
          */
         hwframe_ctx = (AVHWFramesContext*)ctx->hw_frames_ctx->data;
         hwframe_ctx->format = AV_PIX_FMT_CUDA;
-        hwframe_ctx->sw_format = AV_PIX_FMT_NV12;
+        hwframe_ctx->sw_format = ist->st->codecpar->format == AV_PIX_FMT_YUV420P10 ? AV_PIX_FMT_P010 : AV_PIX_FMT_NV12;
     }
 
     return 0;
@@ -147,7 +147,7 @@ error:
 
 cancel:
     if (ist->hwaccel_id == HWACCEL_CUVID) {
-        av_log(NULL, AV_LOG_ERROR, "CUVID hwaccel requested, but impossible to achive.\n");
+        av_log(NULL, AV_LOG_ERROR, "CUVID hwaccel requested, but impossible to achieve.\n");
         return AVERROR(EINVAL);
     }