]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cuvid.c
Merge commit 'd2e56cf753a6c462041dee897d9d0c90f349988c'
[ffmpeg] / libavcodec / cuvid.c
index 27a4c30b006ca75b316481f466f54b450a5bf6d2..eafce0ac19074cdc67275477b551592d629840e4 100644 (file)
@@ -141,9 +141,11 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
         return 1;
 
     if (ctx->cudecoder) {
-        av_log(avctx, AV_LOG_ERROR, "re-initializing decoder is not supported\n");
-        ctx->internal_error = AVERROR(EINVAL);
-        return 0;
+        av_log(avctx, AV_LOG_TRACE, "Re-initializing decoder\n");
+        ctx->internal_error = CHECK_CU(cuvidDestroyDecoder(ctx->cudecoder));
+        if (ctx->internal_error < 0)
+            return 0;
+        ctx->cudecoder = NULL;
     }
 
     if (hwframe_ctx->pool && (
@@ -662,11 +664,6 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
     ctx->cuparseinfo.pExtVideoInfo = &ctx->cuparse_ext;
 
     switch (avctx->codec->id) {
-#if CONFIG_H263_CUVID_DECODER
-    case AV_CODEC_ID_H263:
-        ctx->cuparseinfo.CodecType = cudaVideoCodec_MPEG4;
-        break;
-#endif
 #if CONFIG_H264_CUVID_DECODER
     case AV_CODEC_ID_H264:
         ctx->cuparseinfo.CodecType = cudaVideoCodec_H264;
@@ -893,10 +890,6 @@ static const AVOption options[] = {
 DEFINE_CUVID_CODEC(hevc, HEVC)
 #endif
 
-#if CONFIG_H263_CUVID_DECODER
-DEFINE_CUVID_CODEC(h263, H263)
-#endif
-
 #if CONFIG_H264_CUVID_DECODER
 DEFINE_CUVID_CODEC(h264, H264)
 #endif