changeset 3733:da090f448c88

fix for livelock reported by joker...
author William Pitcock <nenolod@atheme.org>
date Sat, 13 Oct 2007 19:31:02 -0500
parents 40d138de8460
children e82ec5cb017c
files src/audacious/playlist.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Sat Oct 13 19:12:09 2007 -0500
+++ b/src/audacious/playlist.c	Sat Oct 13 19:31:02 2007 -0500
@@ -2627,7 +2627,9 @@
                            Restart. */
                         node = playlist->entries;
                 }
-                else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) {
+                else if ((entry->tuple != NULL || entry->title != NULL) && 
+                    tuple_get_int(entry->tuple, FIELD_LENGTH, NULL) > -1 &&
+                    tuple_get_int(entry->tuple, FIELD_MTIME, NULL) != -1) {
                     update_playlistwin = TRUE;
                     break;
                 }
@@ -2671,10 +2673,12 @@
                         node = g_list_nth(playlist->entries,
                                           playlistwin_get_toprow());
                  }
-                 else if ((entry->tuple != NULL || entry->title != NULL) && entry->length != -1) {
+                 else if ((entry->tuple != NULL || entry->title != NULL) && 
+                     tuple_get_int(entry->tuple, FIELD_LENGTH, NULL) > -1 &&
+                     tuple_get_int(entry->tuple, FIELD_MTIME, NULL) != -1) {
                      update_playlistwin = TRUE;
-                        // no need for break here since this iteration is very short.
-                }
+                     break;
+                 }
             }
         } // on_demand
         else if (cfg.get_info_on_demand &&