Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th March 2003, 20:49   #1  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
Memory leak with MPEG2Dec3 v1.00?

Code:
#include<windows.h>
#include<vfw.h>
#include<stdio.h>


void main()
	{
	PAVIFILE PAviFile;
	AVIFILEINFO AviFileInfo;
	char *AviFileName = "test.avs";



	AVIFileInit();


	for (int i = 1; i <= 1000; i++)
		{
		printf("Open: %i\n", i);


		if (AVIFileOpen(&PAviFile, AviFileName, OF_READ, 0) != 0)
			{
			printf("AVIFileOpen failed\n");
			goto Exit;
			}


		if (AVIFileInfo(PAviFile, &AviFileInfo, sizeof(AviFileInfo)) != 0)
			{
			printf("AVIFileInfo failed\n");
			AVIFileRelease(PAviFile);
			goto Exit;
			}
		else
			{
			printf("      %ix%i\n", AviFileInfo.dwWidth, AviFileInfo.dwHeight);
			}


		AVIFileRelease(PAviFile);
		}


	Exit:
	AVIFileExit();
	}
I'm using this script and monitoring the memory usage with the Task Manager under Wondows 2000 SP3:

Code:
LoadPlugin("c:\yv12\MPEG2Dec3\MPEG2Dec3.dll")
mpeg2source("D:\regina\reg.d2v")
crop(0,72,720,432)
LanczosResize(704,432,0,0.75)
trim(50000, 50999)
Opening/closing the script seems to leak a lot of memory.
The same happen if you open/close more than one time the file with VDubMod.


Using AviSynth 2.0.7 and the usual mpeg2dec works correctly.


I'm using VC 6.0 SP5 to compile the test program:
Code:
cl test.cpp /link vfw32.lib
(source + binary attached, simply put test.exe in a folder where you have "test.avs")
Or you can download here: http://jonny.leffe.dnsalias.com/doom9/test.zip


My apologies if i'm missing something, anyway i can't figure out what happen (if this isn't a memory leak)

Last edited by jonny; 15th May 2003 at 14:02.
jonny is offline   Reply With Quote
Old 6th March 2003, 21:21   #2  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
I only get a 0-byte ZIP file. Could you reattach it?
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 6th March 2003, 21:27   #3  |  Link
jonny
Registered User
 
jonny's Avatar
 
Join Date: Feb 2002
Location: Italy
Posts: 876
It's strange, i've tried to reattach but a message pop up, telling that the file is already uploaded

You can download here:
http://jonny.leffe.dnsalias.com/doom9/test.zip

Last edited by jonny; 15th May 2003 at 14:01.
jonny is offline   Reply With Quote
Old 6th March 2003, 21:48   #4  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
As for the leaks - it is very possible. MPEG2DEC3 has some internal buffering, and I'm not sure if Marc deallocates them, when the filter is unloaded.

I looked loosely through the code, and there are no obvious leaks. It is too complex to track each allocation manually - unless someone has several hours available.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.