不太完美的解决方案,只是降低了内存泄漏的速度,楼主的那个14M的可以放了,但绿叶的那个180M的还是不行。我会在下次dshow2raw更新时加入修正的vsfilter。
附补丁(guliverkli2)
Index: src/subtitles/RTS.cpp
===================================================================
--- src/subtitles/RTS.cpp (revision 97)
+++ src/subtitles/RTS.cpp (working copy)
@@ -1386,18 +1386,20 @@
int nTags = 0, nUnrecognizedTags = 0;
+ CStringW cmd;
+ CAtlArray params;
+ CStringW param;
+ CStringW s;
+ CStringW p;
for(int i = 0, j; (j = str.Find('\\', i)) >= 0; i = j)
{
-CStringW cmd;
for(WCHAR c = str[++j]; c && c != '(' && c != '\\'; cmd += c, c = str[++j]);
cmd.Trim();
if(cmd.IsEmpty()) continue;
-CAtlArray params;
if(str[j] == '(')
{
- CStringW param;
for(WCHAR c = str[++j]; c && c != ')'; param += c, c = str[++j]);
param.Trim();
@@ -1407,7 +1409,7 @@
if(i >= 0 && (j < 0 || i < j))
{
- CStringW s = param.Left(i).Trim();
+ s = param.Left(i).Trim();
if(!s.IsEmpty()) params.Add(s);
param = i+1 < param.GetLength() ? param.Mid(i+1) : L"";
}
@@ -1442,7 +1444,7 @@
;
else if(!cmd.Find(L"c"))
params.Add(cmd.Mid(1).Trim(L"&H")), cmd = cmd.Left(1);
-else if(!cmd.Find(L"fade"))
+else if(!cmd.Find(L"fade"))
;
else if(!cmd.Find(L"fe"))
params.Add(cmd.Mid(2)), cmd = cmd.Left(2);
@@ -1507,7 +1509,7 @@
// TODO: call ParseStyleModifier(cmd, params, ..) and move the rest there
-CStringW p = params.GetCount() > 0 ? params[0] : L"";
+p = params.GetCount() > 0 ? params[0] : L"";
if(cmd == "1c" || cmd == L"2c" || cmd == L"3c" || cmd == L"4c")
{