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
Watch / Listen Media
Listen Music
Unable to play
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="Ben" data-source="post: 973231" data-attributes="member: 19473"><p>Got the latest version from GitHub, compiled it and started it in Visual Studio in debug mode. The song plays fine. I don't know if it uses the BASS engine. In configuration 'Player', is blank.</p><p>How can I check it is using the BASS engine?</p><p> </p><p>I also had a look at MP hanging when I go to the MP3 directory:</p><p> </p><p>It's this routine that is in a 'forever' loop:</p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'"> </span></span></span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'">protected virtual void SwitchToNextAllowedLayout(Layout selectedLayout)</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'">{</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> int iSelectedLayout = (int)selectedLayout;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> int totalLayouts = Enum.GetValues(typeof(Layout)).Length - 1;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> if (iSelectedLayout > totalLayouts)</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> iSelectedLayout = 0;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> bool shouldContinue = true;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> do</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> {</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> if (!AllowLayout(selectedLayout) || facadeLayout.IsNullLayout(selectedLayout))</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> {</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> iSelectedLayout++;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> if (iSelectedLayout > totalLayouts)</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> iSelectedLayout = 0;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> }</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> else</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> {</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> shouldContinue = false;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> }</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> } while (shouldContinue);</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> CurrentLayout = (Layout)iSelectedLayout;</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"> SwitchLayout();</span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'">}</span></span></p><p> </p><p><span style="font-size: 12px"><span style="font-size: 12px">What I see happening is:</span></span></p><p> </p><p>totalLayouts = 6;</p><p> </p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'">in the while(shouldContinue) loop my</span></span></span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'">iSelectedLayout becomes greater than the totalLayouts which causes iSlectedlayout to</span></span></span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'">be reset to 0, and the loop continues forever because shouldContinue is never set to false;</span></span></span></span></p><p> </p><p> </p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'">I have no idea what it actually tries to do, but looking at the logic in the loop I think </span></span></span></span><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'">that testing selectedLayout in this line:</span></span></span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'">if (!AllowLayout(selectedLayout) || facadeLayout.IsNullLayout(selectedLayout))</span></span></span></span></p><p><span style="font-size: 12px"><span style="font-size: 12px"><span style="font-size: 12px"><span style="font-size: 12px">is not a good idea if you actually increase iSelectedLayout in the loop. </span></span></span></span></p><p><span style="font-size: 12px"><span style="font-family: 'Consolas'"><span style="font-size: 12px"><span style="font-family: 'Consolas'">That is probably problem 1. But if you would change that, testing iSelectedLayout, you still have a risk of a forever loop if none of the layouts is ever accepted, so you would need to make sure that when all possibilities have been tried, you get out of the loop or throw an exception.</span></span></span></span></p></blockquote><p></p>
[QUOTE="Ben, post: 973231, member: 19473"] Got the latest version from GitHub, compiled it and started it in Visual Studio in debug mode. The song plays fine. I don't know if it uses the BASS engine. In configuration 'Player', is blank. How can I check it is using the BASS engine? I also had a look at MP hanging when I go to the MP3 directory: It's this routine that is in a 'forever' loop: [SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas] [/FONT][/SIZE][/FONT][/SIZE] [SIZE=3][FONT=Consolas]protected virtual void SwitchToNextAllowedLayout(Layout selectedLayout)[/FONT][/SIZE] [SIZE=3][FONT=Consolas]{[/FONT][/SIZE] [SIZE=3][FONT=Consolas] int iSelectedLayout = (int)selectedLayout;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] int totalLayouts = Enum.GetValues(typeof(Layout)).Length - 1;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] if (iSelectedLayout > totalLayouts)[/FONT][/SIZE] [SIZE=3][FONT=Consolas] iSelectedLayout = 0;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] bool shouldContinue = true;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] do[/FONT][/SIZE] [SIZE=3][FONT=Consolas] {[/FONT][/SIZE] [SIZE=3][FONT=Consolas] if (!AllowLayout(selectedLayout) || facadeLayout.IsNullLayout(selectedLayout))[/FONT][/SIZE] [SIZE=3][FONT=Consolas] {[/FONT][/SIZE] [SIZE=3][FONT=Consolas] iSelectedLayout++;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] if (iSelectedLayout > totalLayouts)[/FONT][/SIZE] [SIZE=3][FONT=Consolas] iSelectedLayout = 0;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] }[/FONT][/SIZE] [SIZE=3][FONT=Consolas] else[/FONT][/SIZE] [SIZE=3][FONT=Consolas] {[/FONT][/SIZE] [SIZE=3][FONT=Consolas] shouldContinue = false;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] }[/FONT][/SIZE] [SIZE=3][FONT=Consolas] } while (shouldContinue);[/FONT][/SIZE] [SIZE=3][FONT=Consolas] CurrentLayout = (Layout)iSelectedLayout;[/FONT][/SIZE] [SIZE=3][FONT=Consolas] SwitchLayout();[/FONT][/SIZE] [SIZE=3][FONT=Consolas]}[/FONT][/SIZE] [SIZE=3][SIZE=3]What I see happening is:[/SIZE][/SIZE] totalLayouts = 6; [SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas]in the while(shouldContinue) loop my[/FONT][/SIZE][/FONT][/SIZE] [SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas]iSelectedLayout becomes greater than the totalLayouts which causes iSlectedlayout to[/FONT][/SIZE][/FONT][/SIZE] [SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas]be reset to 0, and the loop continues forever because shouldContinue is never set to false;[/FONT][/SIZE][/FONT][/SIZE] [SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas]I have no idea what it actually tries to do, but looking at the logic in the loop I think [/FONT][/SIZE][/FONT][/SIZE][SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas]that testing selectedLayout in this line:[/FONT][/SIZE][/FONT][/SIZE] [SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas]if (!AllowLayout(selectedLayout) || facadeLayout.IsNullLayout(selectedLayout))[/FONT][/SIZE][/FONT][/SIZE] [SIZE=3][SIZE=3][SIZE=3][SIZE=3]is not a good idea if you actually increase iSelectedLayout in the loop. [/SIZE][/SIZE][/SIZE][/SIZE] [SIZE=3][FONT=Consolas][SIZE=3][FONT=Consolas]That is probably problem 1. But if you would change that, testing iSelectedLayout, you still have a risk of a forever loop if none of the layouts is ever accepted, so you would need to make sure that when all possibilities have been tried, you get out of the loop or throw an exception.[/FONT][/SIZE][/FONT][/SIZE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Watch / Listen Media
Listen Music
Unable to play
Contact us
RSS
Top
Bottom