ready for tagging?

Gary Steinert gary.steinert at gmail.com
Mon Mar 8 05:31:30 CET 2010


On Monday 08 Mar 2010 03:34:50 Leo Franchi wrote:
> On Sun, Mar 7, 2010 at 1:56 PM, Karl Vollmer <vollmer at ampache.org> wrote:
> > The bug relating to the Ampache service are definite blockers. (3
> > copies of every track). If these can't be fixed before tagging, the
> > service should be disabled/removed as it is currently unusable. I will
> > not have time before wed, or anytime soon to fix it :(.
> >
> > -Karl
> >
> > On Sun, Mar 7, 2010 at 2:47 PM, Lydia Pintscher <lydia at kde.org> wrote:
> >> Heya folks :)
> >>
> >> Are we ready for tagging on Wednesday?
> >> Any problems I should be aware of?
> >>
> >>
> >> Cheers
> >> Lydia
> 
> Gary on IRC just found a pretty severe bug (and I confirmed):
> 
> Basically, the queue function with random mode is broken.
> 
> 1) Queue 2 or 3 tracks. (A B C D)
> 2) Advance 4-5 times.
> 3) Tracks played: A B C D C B A <random from here on>. expected: A B C
> D <random from here on>
> 
> looks like the queue is being "played back" in reverse order.
> 
> i dont know if this is a blocker, but this is a pretty bad bug.
> 
> leo
> 
I've been looking through the code, and the problem is definitely within 
Playlist::RandomTrackNavigator::likelyLastTrack()

This functions, as far as I understand it, should not change any data (namely 
the three lists used to decide which tracks to play when skipping back and 
forwards).

The function, however, moves the currently playing track from the playedRows 
list (where it should be) to the replayedRows list, which it would do if we 
were actually skipping back a track. This, I believe, is the root of the 
problem.

I have come to a number of dead ends looking trying to fix it, I need some help 
understanding the code before I can continue.

diff --git a/src/playlist/navigators/RandomTrackNavigator.cpp 
b/src/playlist/navigators/RandomTrackNavigator.cpp
index 98b4938..a7f4f70 100644
--- a/src/playlist/navigators/RandomTrackNavigator.cpp
+++ b/src/playlist/navigators/RandomTrackNavigator.cpp
@@ -153,9 +153,7 @@ Playlist::RandomTrackNavigator::likelyLastTrack()

     if( requestedTrack == m_model->activeId() )
     {
-        m_playedRows.removeFirst();
-        m_replayedRows.prepend( requestedTrack );
-        requestedTrack = m_playedRows.isEmpty() ? 0 : m_playedRows.first();
+        requestedTrack = m_playedRows.count() > 1 ? m_playedRows.at( 1 ) : 0;
     }
     return requestedTrack;
 }

The above diff is my progress so far. It removes the problem f moving data 
between the lists, but when trying to skip back, it will skip back once, then 
keep skipping back to the same song (i.e. you start on Track C, skip back to 
B, then instead of skipping back to A, every subsequent back skip skips back 
to B over and over again).

Also, lines 145-150 in RandomTrackNavigator.cpp seem to present a similar 
problem. Not sure it is related to this bug though.

-- 
Gary Steinert
gary.steinert at gmail.com
Q:	How do you keep a moron in suspense?


More information about the Amarok-devel mailing list