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
Development
General Development (no feature request here!)
GUIImage Bug and Patch
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="fforde" data-source="post: 338229" data-attributes="member: 52082"><p>While working on an enhancement for Moving Pictures I came across a bug in the MediaPortal GUIImage class. Briefly, if a GUIImage has been assigned a property (i.e. #MyCoverArtwork) rather than a filename for it's <texture> field, each time the value of this property changes MediaPortal tries to unload the old image and load in the new image. The <em>problem</em> is that it executes the FreeResources() method <em>after</em> the "filename" variable has been changed. Which means that it attempts to release the texture for the NEW filename rather than the old. The old texture stays in memory <em> indefinitely</em> unless some class outside the GUITextureManager explicitly asks for it to be deallocated.</p><p></p><p>This in <em>most</em> cases is relatively harmless but in some cases this could cause an unnecessary amount of video memory to be used. This behavior also creates a problem if you try to preload a texture. If you were to preload a texture in a separate thread and then, when loading had completed, reassign the corresponding property to update the GUIImage object, the GUIImage would proceed to <em>unload</em> the just loaded texture, and then reload it again. Obviously not desirable behavior, this will accomplish nothing but slow down the GUI. </p><p></p><p>So based on this I have created a patch to correct this behavior. With this patch the GUIImage object will now clear the previous texture when a property is changed and <em>then</em> try to load the new texture if needed. Because it may also be desirable to load a texture into memory and have it persist until explicitly removed (similar to how skin textures are handled) I have also added a new Load() method in the GUITextureManager with an additional parameter to specify if the image being loaded should be persistent. </p><p></p><p>The patch is attached to this post and is based on SVN revision 20960. If anyone has any questions about this fix, feel free to PM me. If after reviewing the patch you find a problem, let me know and maybe I can make a revision.</p></blockquote><p></p>
[QUOTE="fforde, post: 338229, member: 52082"] While working on an enhancement for Moving Pictures I came across a bug in the MediaPortal GUIImage class. Briefly, if a GUIImage has been assigned a property (i.e. #MyCoverArtwork) rather than a filename for it's <texture> field, each time the value of this property changes MediaPortal tries to unload the old image and load in the new image. The [i]problem[/i] is that it executes the FreeResources() method [I]after[/I] the "filename" variable has been changed. Which means that it attempts to release the texture for the NEW filename rather than the old. The old texture stays in memory [I] indefinitely[/I] unless some class outside the GUITextureManager explicitly asks for it to be deallocated. This in [I]most[/I] cases is relatively harmless but in some cases this could cause an unnecessary amount of video memory to be used. This behavior also creates a problem if you try to preload a texture. If you were to preload a texture in a separate thread and then, when loading had completed, reassign the corresponding property to update the GUIImage object, the GUIImage would proceed to [i]unload[/i] the just loaded texture, and then reload it again. Obviously not desirable behavior, this will accomplish nothing but slow down the GUI. So based on this I have created a patch to correct this behavior. With this patch the GUIImage object will now clear the previous texture when a property is changed and [i]then[/i] try to load the new texture if needed. Because it may also be desirable to load a texture into memory and have it persist until explicitly removed (similar to how skin textures are handled) I have also added a new Load() method in the GUITextureManager with an additional parameter to specify if the image being loaded should be persistent. The patch is attached to this post and is based on SVN revision 20960. If anyone has any questions about this fix, feel free to PM me. If after reviewing the patch you find a problem, let me know and maybe I can make a revision. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
GUIImage Bug and Patch
Contact us
RSS
Top
Bottom