Code

screen_play: use "idx" instead of "song->pos"
authorMax Kellermann <max@duempel.org>
Wed, 8 Jul 2009 21:11:40 +0000 (23:11 +0200)
committerMax Kellermann <max@duempel.org>
Wed, 8 Jul 2009 21:11:40 +0000 (23:11 +0200)
The attribute song->pos may be unreliable.  Since the list_window.c
code already passed the current position to us (parameter "idx"),
let's use it instead.

src/screen_play.c

index e1944663068da3d46aa6f40e5718786c9c1bd39d..fe9b5c2659ca6ecab6c9860588ab8181377026d3 100644 (file)
@@ -127,7 +127,7 @@ list_callback(unsigned idx, bool *highlight, char **second_column, G_GNUC_UNUSED
        if(second_column)
                *second_column = format_duration(song->time);
 
-       if ((unsigned)song->pos == lw->selected)
+       if (idx == lw->selected)
        {
                if (options.scroll && utf8_width(songname) > (unsigned)COLS)
                {