Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg.git.patch9
index f16968a791af0c62e7b230f1a9876aff1dd3616c..721fd09dac6469f2c6deff5c2cc99eb23b4b1d1b 100644 (file)
@@ -1,35 +1,14 @@
---- a/libavutil/hwcontext_cuda.c       2019-12-03 10:04:24.521156775 -0700
-+++ b/libavutil/hwcontext_cuda.c       2019-12-03 10:59:03.924121027 -0700
-@@ -282,9 +282,11 @@
-         CudaFunctions *cu = hwctx->internal->cuda_dl;
+--- a/libavformat/mpegenc.c
++++ b/libavformat/mpegenc.c
+@@ -987,9 +987,9 @@
+         PacketDesc *pkt_desc;
  
-         if (hwctx->internal->is_allocated && hwctx->cuda_ctx) {
-+#ifdef CUDA_PRIMARY_CTX
-             if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT)
-                 CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
-             else
-+#endif
-                 CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx));
-             hwctx->cuda_ctx = NULL;
-@@ -351,7 +353,7 @@
-         goto error;
-     hwctx->internal->flags = flags;
--
-+#ifdef CUDA_PRIMARY_CTX
-     if (flags & AV_CUDA_USE_PRIMARY_CONTEXT) {
-         ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device, &dev_flags, &dev_active));
-         if (ret < 0)
-@@ -369,7 +371,10 @@
-         ret = CHECK_CU(cu->cuDevicePrimaryCtxRetain(&hwctx->cuda_ctx, hwctx->internal->cuda_device));
-         if (ret < 0)
-             goto error;
--    } else {
-+    }
-+    else
-+#endif
-+    {
-         ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device));
-         if (ret < 0)
-             goto error;
+         while ((pkt_desc = stream->predecode_packet) &&
++               pkt_desc != stream->premux_packet &&
+                scr > pkt_desc->dts) { // FIXME: > vs >=
+-            if (stream->buffer_index < pkt_desc->size ||
+-                stream->predecode_packet == stream->premux_packet) {
++            if (stream->buffer_index < pkt_desc->size) {
+                 av_log(ctx, AV_LOG_ERROR,
+                        "buffer underflow st=%d bufi=%d size=%d\n",
+                        i, stream->buffer_index, pkt_desc->size);