[Mplayerplug-in-devel] browser hangs
Brought to you by:
kdekorte
From: Gabriel L. G. <gl...@tl...> - 2006-12-06 11:40:54
|
Hello, I've written a simple extension that allows me to issue shell comands (with popen()) from javascript. The main objective is to be able to adjust the volume, but it will have other uses. The main method is shown below. After a few calls (2 or 3) the browser hangs, until the music ends. But my component works well on its own. =20 Is this an issue with mplayerplug-in, or am I overlooking something in = my=20 code? Thanks, Gabriel L=FChers Gra=E7a gl...@tl...=20 /* long system (in string cmd); */ NS_IMETHODIMP MozShell::System(const char* cmd, PRInt32 *_retval) { FILE *fp; char path[256]; printf("Executing %s...\n", cmd); fp=3Dpopen(cmd,"r"); while(fgets(path, 256, fp)!=3DNULL) { printf(path); } printf("Finished %s\n", cmd); *_retval=3Dpclose(fp); =20 return NS_OK; } |