changeset 398:f908bcd87c3d trunk

[svn] Generate cache content on demand if it was not previously there.
author nenolod
date Sat, 07 Jan 2006 10:13:28 -0800
parents 4fa1244ad483
children db2fcdad1d6d
files audacious/playlist.c audacious/playlist.h libaudcore/playback.c libaudcore/playback.h
diffstat 4 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/audacious/playlist.c	Sat Jan 07 10:02:25 2006 -0800
+++ b/audacious/playlist.c	Sat Jan 07 10:13:28 2006 -0800
@@ -2436,7 +2436,7 @@
     return filename;
 }
 
-const PlaylistEntry *
+PlaylistEntry *
 playlist_get_entry_to_play(void)
 {
     PLAYLIST_LOCK();
--- a/audacious/playlist.h	Sat Jan 07 10:02:25 2006 -0800
+++ b/audacious/playlist.h	Sat Jan 07 10:13:28 2006 -0800
@@ -108,7 +108,7 @@
 void playlist_delete_index(guint pos);
 void playlist_delete_filenames(GList * filenames);
 
-const PlaylistEntry *playlist_get_entry_to_play();
+PlaylistEntry *playlist_get_entry_to_play();
 
 /* XXX this is for reverse compatibility --nenolod */
 const gchar *playlist_get_filename_to_play();
--- a/libaudcore/playback.c	Sat Jan 07 10:02:25 2006 -0800
+++ b/libaudcore/playback.c	Sat Jan 07 10:13:28 2006 -0800
@@ -83,7 +83,7 @@
 void
 bmp_playback_initiate(void)
 {
-    const PlaylistEntry *entry;
+    PlaylistEntry *entry;
 
     if (playlist_get_length() == 0)
         return;
@@ -201,7 +201,7 @@
 }
 
 gboolean
-bmp_playback_play_file(const PlaylistEntry *entry)
+bmp_playback_play_file(PlaylistEntry *entry)
 {
     g_return_val_if_fail(entry != NULL, FALSE);
 
@@ -214,6 +214,9 @@
     if (cfg.random_skin_on_play)
         bmp_playback_set_random_skin();
 
+    if (!entry->decoder)
+	entry->decoder = input_check_file(entry->filename, FALSE);
+
     if (!entry->decoder || !input_is_enabled(entry->decoder->filename))
     {
         input_file_not_playable(entry->filename);
--- a/libaudcore/playback.h	Sat Jan 07 10:02:25 2006 -0800
+++ b/libaudcore/playback.h	Sat Jan 07 10:13:28 2006 -0800
@@ -29,7 +29,7 @@
 void bmp_playback_pause(void);
 void bmp_playback_stop(void);
 void bmp_playback_stop_reentrant(void);
-gboolean bmp_playback_play_file(const PlaylistEntry *entry);
+gboolean bmp_playback_play_file(PlaylistEntry *entry);
 gboolean bmp_playback_get_playing(void);
 gboolean bmp_playback_get_paused(void);
 void bmp_playback_seek(gint time);