changeset 1841:7d0cd3fab6a2 trunk

[svn] - mtime=-1 has been introduced to represent "uninitialized". - scanning for uninitialized tuple works correctly. - "Update View" works again.
author yaz
date Fri, 06 Oct 2006 10:50:55 -0700
parents b64edd53d3a9
children d1b88145846f
files ChangeLog audacious/playlist.c
diffstat 2 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 05 22:41:09 2006 -0700
+++ b/ChangeLog	Fri Oct 06 10:50:55 2006 -0700
@@ -1,3 +1,11 @@
+2006-10-06 05:41:09 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [2637]
+  - actually, apparently we need that... fucking apple
+  
+  trunk/audacious/mainwin.c |    6 ++++++
+  1 file changed, 6 insertions(+)
+
+
 2006-10-06 05:38:01 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2635]
   - only set window hints after the resize
--- a/audacious/playlist.c	Thu Oct 05 22:41:09 2006 -0700
+++ b/audacious/playlist.c	Fri Oct 06 10:50:55 2006 -0700
@@ -178,7 +178,7 @@
 
     g_return_val_if_fail(entry != NULL, FALSE);
 
-    if (!entry->tuple || entry->tuple->mtime > 0)
+    if (entry->tuple == NULL || entry->tuple->mtime > 0 || entry->tuple->mtime == -1)
 	modtime = playlist_get_mtime(entry->filename);
     else
 	modtime = 0;  /* URI -nenolod */
@@ -1556,8 +1556,9 @@
     entry = node->data;
 
     /* FIXME: simplify this logic */
-    if ((!entry->title && entry->length == -1) || 
-	 (entry->tuple && (entry->tuple->mtime > 0 && entry->tuple->mtime != playlist_get_mtime(entry->filename))) ){
+    if ((entry->title == NULL && entry->length == -1) ||
+        (entry->tuple && entry->tuple->mtime != 0 && (entry->tuple->mtime == -1 || entry->tuple->mtime != playlist_get_mtime(entry->filename))))
+    {
         if (playlist_entry_get_info(entry))
             title = entry->title;
     }
@@ -1599,7 +1600,9 @@
     tuple = entry->tuple;
 
     // if no tuple or tuple with old mtime, get new one.
-    if (!tuple || (entry->tuple->mtime > 0 && entry->tuple->mtime != playlist_get_mtime(entry->filename))) {
+    if (tuple == NULL || 
+        (entry->tuple && entry->tuple->mtime != 0 && (entry->tuple->mtime == -1 || entry->tuple->mtime != playlist_get_mtime(entry->filename))))
+    {
         playlist_entry_get_info(entry);
         tuple = entry->tuple;
     }
@@ -1629,8 +1632,8 @@
     }
 
     entry = node->data;
-
-    if (!entry->tuple || (entry->tuple->mtime > 0 && entry->tuple->mtime != playlist_get_mtime(entry->filename))){
+    if (entry->tuple == NULL ||
+        (entry->tuple->mtime != 0 && (entry->tuple->mtime == -1 || entry->tuple->mtime != playlist_get_mtime(entry->filename)))) {
 
         if (playlist_entry_get_info(entry))
             song_time = entry->length;
@@ -2088,8 +2091,8 @@
     PLAYLIST_UNLOCK();
 
     /* No tuple? Try to set this entry up properly. --nenolod */
-    if (entry->tuple == NULL || entry->tuple->mtime == 0 ||
-	(entry->tuple->mtime != playlist_get_mtime(entry->filename)))
+    if (entry->tuple == NULL || entry->tuple->mtime == -1 ||
+        entry->tuple->mtime == 0 || entry->tuple->mtime != playlist_get_mtime(entry->filename))
     {
         playlist_entry_get_info(entry);
         tuple = entry->tuple;
@@ -2631,7 +2634,7 @@
 
 	/* invalidate mtime to reread */
 	if (entry->tuple != NULL)
-	    entry->tuple->mtime = 0;
+	    entry->tuple->mtime = -1; /* -1 denotes "non-initialized". now 0 is for stream etc. yaz */
 
         if (!playlist_entry_get_info(entry)) {
             if (g_list_index(playlist_get(), entry) == -1)