@@ -540,15 +540,37 @@ def _fix_mv_args(args):
540540 # Patch 4: EEDI3CL fallback — modern eedi3m plugin removed EEDI3CL (OpenCL).
541541 # When opencl=True, havsfunc tries core.eedi3m.EEDI3CL which doesn't exist.
542542 # Fall back to CPU EEDI3 so opencl mode works (NNEDI3CL still uses GPU).
543- $OldEedi3cl = " myEEDI3 = core.eedi3m.EEDI3CL`n "
544- if ($Content.Contains ($OldEedi3cl )) {
545- Write-Host " Applying EEDI3CL fallback patch..." - ForegroundColor Gray
546- $NewEedi3cl = " has_eedi3cl = hasattr(core, 'eedi3m') and hasattr(core.eedi3m, 'EEDI3CL')`n myEEDI3 = core.eedi3m.EEDI3CL if has_eedi3cl else (core.eedi3m.EEDI3 if hasattr(core, 'eedi3m') else core.eedi3.eedi3)`n "
547- $Content = $Content.Replace ($OldEedi3cl , $NewEedi3cl )
548-
549- $OldArgs = " eedi3_args = dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=EdiMaxD, vcheck=vcheck, device=device)`n "
550- $NewArgs = " eedi3_args = dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=EdiMaxD, vcheck=vcheck, device=device) if has_eedi3cl else dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=EdiMaxD, vcheck=vcheck)`n "
551- $Content = $Content.Replace ($OldArgs , $NewArgs )
543+ # Two locations: santiag_stronger (12-space indent) and QTGMC_Interpolate (8-space indent).
544+ # Must patch deeper indent first to avoid substring matches with .Replace().
545+ $PatchedEedi3cl = $false
546+
547+ # 4a: santiag_stronger (12-space indent, uses mdis=mdis)
548+ $OldSantiag = " myEEDI3 = core.eedi3m.EEDI3CL`n "
549+ if ($Content.Contains ($OldSantiag )) {
550+ Write-Host " Applying EEDI3CL fallback patch (santiag_stronger)..." - ForegroundColor Gray
551+ $NewSantiag = " has_eedi3cl = hasattr(core, 'eedi3m') and hasattr(core.eedi3m, 'EEDI3CL')`n myEEDI3 = core.eedi3m.EEDI3CL if has_eedi3cl else (core.eedi3m.EEDI3 if hasattr(core, 'eedi3m') else core.eedi3.eedi3)`n "
552+ $Content = $Content.Replace ($OldSantiag , $NewSantiag )
553+
554+ $OldSantiagArgs = " eedi3_args = dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=mdis, vcheck=vcheck, device=device)`n "
555+ $NewSantiagArgs = " eedi3_args = dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=mdis, vcheck=vcheck, device=device) if has_eedi3cl else dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=mdis, vcheck=vcheck)`n "
556+ $Content = $Content.Replace ($OldSantiagArgs , $NewSantiagArgs )
557+ $PatchedEedi3cl = $true
558+ }
559+
560+ # 4b: QTGMC_Interpolate (8-space indent, uses mdis=EdiMaxD)
561+ $OldQtgmc = " myEEDI3 = core.eedi3m.EEDI3CL`n "
562+ if ($Content.Contains ($OldQtgmc )) {
563+ Write-Host " Applying EEDI3CL fallback patch (QTGMC_Interpolate)..." - ForegroundColor Gray
564+ $NewQtgmc = " has_eedi3cl = hasattr(core, 'eedi3m') and hasattr(core.eedi3m, 'EEDI3CL')`n myEEDI3 = core.eedi3m.EEDI3CL if has_eedi3cl else (core.eedi3m.EEDI3 if hasattr(core, 'eedi3m') else core.eedi3.eedi3)`n "
565+ $Content = $Content.Replace ($OldQtgmc , $NewQtgmc )
566+
567+ $OldQtgmcArgs = " eedi3_args = dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=EdiMaxD, vcheck=vcheck, device=device)`n "
568+ $NewQtgmcArgs = " eedi3_args = dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=EdiMaxD, vcheck=vcheck, device=device) if has_eedi3cl else dict(alpha=alpha, beta=beta, gamma=gamma, nrad=nrad, mdis=EdiMaxD, vcheck=vcheck)`n "
569+ $Content = $Content.Replace ($OldQtgmcArgs , $NewQtgmcArgs )
570+ $PatchedEedi3cl = $true
571+ }
572+
573+ if ($PatchedEedi3cl ) {
552574 $PatchesApplied += " EEDI3CL fallback"
553575 }
554576
0 commit comments