Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> AMIP crashs if outputfile is readonly or being accessed [Foobar2k Plugin]
Trampi
post Sep 21 2008, 11:14 AM
Post #1


Newbie
*

Group: Members
Posts: 2
Joined: 21-September 08
Member No.: 603



Hello.
I use the fileoutput-function of AMIP to display current song and so on on my little Character-LCD.
So i've written a script which reads from the file which AMIP puts out.

Code i use:
CODE

$if(%playing,%1
%2
[%pm:%ps/%min:%sec]
Playing,)



Now if AMIP wants to write, i've checked the setting that it writes every second, AMIP (and Foobar) crashs, because it can't write. First i were not sure if my script maybe does something that could crash, but after i did some tests i am sure that AMIP crashs if the outputfile is read only or an open handle exists when other programs write or read.

You can try it yourself if you make the outputfile read only. AMIP will crash. I've tested this bug only using foobar, don't know if the bug also exists when using winamp etc..

In my opinion it just shouldn't crash.
I've already tried numerous things in my script that it doesn't open the file when AMIP will access it, but i've only achieved that it crashs every 1-10 minutes.

So, my solution would be the following.

Actual pseudocode:
CODE
FileWrite(Outputfile)


New pseudocode:
CODE
If not IsInUse(outputfile)
    FileWrite(outputfile)
EndIf


Because of the option "Refresh file every second" it will be tested in a second again if its now writeable. If it is - write. If not - wait 1 second and try again.


Thanks in advance and sorry for my bad english.
I hope anyone understands what i want to say.
Trampi
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Serge
post Sep 21 2008, 01:01 PM
Post #2


AMIP Developer
***

Group: Root Admin
Posts: 935
Joined: 12-March 06
Member No.: 1



Nice catch. I've fixed the problem. Replace your amip.dll with this version: http://amip.tools-for.net/files/test/amip.dll .
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Trampi
post Sep 21 2008, 02:03 PM
Post #3


Newbie
*

Group: Members
Posts: 2
Joined: 21-September 08
Member No.: 603



Thanks for your fast fix - seems to be working. smile.gif

Ohh, by the way, i've forgotten to say "Thanks!" for this very good Plugin/Program. It has so many nice features!
Keep on programming it!
It helped me a lot to get the output for my lcd.

Trampi
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: