home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
General Support
DVD insert notification more then 3 times
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="herluf" data-source="post: 406755" data-attributes="member: 89810"><p>Hi - I have been looking at this, since i usually play my music from cd's. The first time a cd is inserted everything plays well, but the next time a cd is inserted it seems a new deviceVolumeMonitor is created and the old one is still listening, so there are now two monitors receiving the "insert" event. The 3rd time a cd is inserted two more monitors are created and so 4 monitors now receive the "insert" event, and so on...</p><p></p><p>The only thing changed as far as i can tell is the following in the Dispose method of DeviceVolumeMonitor.cs:</p><p></p><p> // handle should not be released as this is the handle for MediaPortal itself (just borrowing </p><p> // it for wndproc message purposes). Just nulling the reference and letting the garbage collector</p><p> // clean up is enough to free resources for device monitoring.</p><p> //fInternal.ReleaseHandle();</p><p></p><p>Instead fInternal is just set = null. As mentioned the garbage collector should remove the monitor, but it seems this doesn't happen. </p><p></p><p>I tried setting DeviceMonitor.Enabled = false; instead of calling dispose from Autoplay.cs and that works (at least for cd's haven't tried dvd's). Enabled = false, calls the releaseHandle by the way. </p><p></p><p>I'm not sure if the correct solution would be to set Enabled = false in the Dispose method just before setting the fInternal = null, but this is just a heads up to anyone willing to correct this or knows how to submit a patch.</p></blockquote><p></p>
[QUOTE="herluf, post: 406755, member: 89810"] Hi - I have been looking at this, since i usually play my music from cd's. The first time a cd is inserted everything plays well, but the next time a cd is inserted it seems a new deviceVolumeMonitor is created and the old one is still listening, so there are now two monitors receiving the "insert" event. The 3rd time a cd is inserted two more monitors are created and so 4 monitors now receive the "insert" event, and so on... The only thing changed as far as i can tell is the following in the Dispose method of DeviceVolumeMonitor.cs: // handle should not be released as this is the handle for MediaPortal itself (just borrowing // it for wndproc message purposes). Just nulling the reference and letting the garbage collector // clean up is enough to free resources for device monitoring. //fInternal.ReleaseHandle(); Instead fInternal is just set = null. As mentioned the garbage collector should remove the monitor, but it seems this doesn't happen. I tried setting DeviceMonitor.Enabled = false; instead of calling dispose from Autoplay.cs and that works (at least for cd's haven't tried dvd's). Enabled = false, calls the releaseHandle by the way. I'm not sure if the correct solution would be to set Enabled = false in the Dispose method just before setting the fInternal = null, but this is just a heads up to anyone willing to correct this or knows how to submit a patch. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
General Support
DVD insert notification more then 3 times
Contact us
RSS
Top
Bottom