Bug 145157 - pressing play in a "Random Mix" crashes Amarok
Summary: pressing play in a "Random Mix" crashes Amarok
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Unclassified
Component: Playlists/Saved Playlists (show other bugs)
Version: 1.4.5
Platform: Gentoo Packages Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-07 21:13 UTC by salijos
Modified: 2007-05-08 08:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description salijos 2007-05-07 21:13:01 UTC
Version:           1.4.5 (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          gcc 4.1.1 
OS:                Linux

If a "Random Mix" smart playlist is active, and "played tracks to show" is set to 0, then pressing play or double-clicking on the first item in the playlist will cause Amarok to crash.  The only exception to this is the first time a random mix is played, double-clicking the first item in the playlist won't crash it the first time.  I tried setting "played tracks to show" to 1, and it works fine.
Comment 1 Mark Kretschmann 2007-05-07 21:24:17 UTC

*** This bug has been marked as a duplicate of 144121 ***
Comment 2 Jeff Mitchell 2007-05-07 23:15:05 UTC
I don't think this is the same bug.  I can duplicate this, but not bug 144121.
Comment 3 Jeff Mitchell 2007-05-07 23:15:24 UTC
Reopening.
Comment 4 Jeff Mitchell 2007-05-07 23:18:42 UTC
This only happens if it was also the currently playing track.  For instance, if you are playing the top track, and then sort the playlist by some value so that it is no longer the top track, and then try to play the top track, there's no crash.
Comment 5 Jeff Mitchell 2007-05-08 00:44:58 UTC
SVN commit 662353 by mitchell:

Fix...
BUG: 145157


 M  +9 -4      playlist.cpp  


--- branches/stable/extragear/multimedia/amarok/src/playlist.cpp #662352:662353
@@ -1604,14 +1604,17 @@
 
     if ( !checkFileStatus( item ) )
     {
-	Amarok::StatusBar::instance()->shortMessage( i18n("Local file does not exist.") );
-	return;
+        Amarok::StatusBar::instance()->shortMessage( i18n("Local file does not exist.") );
+        return;
     }
 
     if( dynamicMode() && !m_dynamicDirt && !Amarok::repeatTrack() )
     {
         if( m_currentTrack && item->isDynamicEnabled() )
-            this->moveItem( item, 0, m_currentTrack );
+        {
+            if( item != m_currentTrack )
+                this->moveItem( item, 0, m_currentTrack );
+        }
         else
         {
             MyIt it( this, MyIt::Visible );
@@ -1639,8 +1642,10 @@
 
         }
         if( m_currentTrack && m_currentTrack != item )
+        {
             m_currentTrack->setDynamicEnabled( false );
-        advanceDynamicTrack();
+            advanceDynamicTrack();
+        }
     }
 
     if( Amarok::entireAlbums() )
Comment 6 Jeff Mitchell 2007-05-08 00:45:44 UTC
*** Bug 144121 has been marked as a duplicate of this bug. ***
Comment 7 salijos 2007-05-08 08:10:07 UTC
The patch given works fine.  Thanks!