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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
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
 

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 20:24.


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