Index: backends/gstreamer/rb-encoder-gst.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/backends/gstreamer/rb-encoder-gst.c,v
retrieving revision 1.9
diff -u -u -r1.9 rb-encoder-gst.c
--- backends/gstreamer/rb-encoder-gst.c	25 Apr 2006 16:00:37 -0000	1.9
+++ backends/gstreamer/rb-encoder-gst.c	26 Apr 2006 11:47:19 -0000
@@ -704,15 +704,19 @@
 			    RhythmDBEntry *entry,
 			    GError **error)
 {
-	const char *uri;
+	char *uri;
 	GstElement *src;
 
-	uri = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION);
+	uri = rhythmdb_entry_get_playback_uri (entry);
+	if (uri == NULL)
+		return NULL;
+
 	src = gst_element_make_from_uri (GST_URI_SRC, uri, "source");
 	if (src == NULL) {
 		g_set_error (error,
 			     RB_ENCODER_ERROR, RB_ENCODER_ERROR_INTERNAL,
 			     "could not create source element for '%s'", uri);
+		g_free (uri);
 		return NULL;
 	}
 
@@ -721,6 +725,8 @@
 
 	/* TODO: add progress reporting */
 
+	g_free (uri);
+
 	return src;
 }
 
@@ -755,7 +761,7 @@
 	       GError **error)
 {
 	/* cdsrc ! encoder ! sink */
-	const char *uri;
+	char *uri;
 	const char *device;
 	const char *profile_name;
 	GMAudioProfile *profile;
@@ -777,7 +783,9 @@
 		return FALSE;
 
 	/* setup cd extraction properties */
-	uri = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION);
+	uri = rhythmdb_entry_get_playback_uri (entry);
+	if (uri == NULL)
+		return FALSE;
 
 	device = g_utf8_strrchr (uri, -1, '#');
 	g_object_set (G_OBJECT (src),
@@ -790,6 +798,7 @@
 		paranoia_mode = 255; /* TODO: make configurable */
 		g_object_set (G_OBJECT (src), "paranoia-mode", paranoia_mode, NULL);
 	}
+	g_free (uri);
 
 	end = add_encoding_pipeline (encoder, profile, error);
 	if (end == NULL)
Index: rhythmdb/rhythmdb.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.c,v
retrieving revision 1.211
diff -u -u -r1.211 rhythmdb.c
--- rhythmdb/rhythmdb.c	25 Apr 2006 22:02:38 -0000	1.211
+++ rhythmdb/rhythmdb.c	26 Apr 2006 11:47:23 -0000
@@ -1084,7 +1084,7 @@
 	g_atomic_int_inc (&ret->refcount);
 
 	if (type->post_entry_create)
-		(type->post_entry_create)(ret);
+		(type->post_entry_create)(ret, type->post_entry_create_data);
 
 	return ret;
 }
@@ -1202,7 +1202,7 @@
 
 	type = rhythmdb_entry_get_entry_type (entry);
 	if (type->pre_entry_destroy)
-		(type->pre_entry_destroy)(entry);
+		(type->pre_entry_destroy)(entry, type->pre_entry_destroy_data);
 
 	g_free (entry->location);
 	g_free (entry->playback_error);
@@ -4113,6 +4113,12 @@
 	return iradio_type;
 }
 
+static char *
+_get_podcast_playback_uri (RhythmDBEntry *entry, gpointer data)
+{
+	return rhythmdb_entry_dup_string (entry, RHYTHMDB_PROP_MOUNTPOINT);
+}
+
 RhythmDBEntryType rhythmdb_entry_podcast_post_get_type (void) 
 {
 	static RhythmDBEntryType podcast_post_type = RHYTHMDB_ENTRY_TYPE_INVALID;
@@ -4120,6 +4126,8 @@
 	g_static_mutex_lock (&entry_type_mutex);
 	if (podcast_post_type == RHYTHMDB_ENTRY_TYPE_INVALID) {
 		podcast_post_type = rhythmdb_entry_register_type ();
+
+		podcast_post_type->get_playback_uri = _get_podcast_playback_uri;
 	}
 	g_static_mutex_unlock (&entry_type_mutex);
 
@@ -4792,6 +4800,18 @@
 		g_assert_not_reached ();
 		return 0.0;
 	}
+}
+
+char *
+rhythmdb_entry_get_playback_uri (RhythmDBEntry *entry)
+{
+	RhythmDBEntryType type;
+
+	type = rhythmdb_entry_get_entry_type (entry);
+	if (type->get_playback_uri)
+		return (type->get_playback_uri) (entry, type->get_playback_uri_data);
+	else
+		return rhythmdb_entry_dup_string (entry, RHYTHMDB_PROP_LOCATION);
 }
 
 GType
Index: rhythmdb/rhythmdb.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb.h,v
retrieving revision 1.81
diff -u -u -r1.81 rhythmdb.h
--- rhythmdb/rhythmdb.h	20 Apr 2006 20:43:28 -0000	1.81
+++ rhythmdb/rhythmdb.h	26 Apr 2006 11:47:23 -0000
@@ -32,6 +32,9 @@
 
 G_BEGIN_DECLS
 
+struct RhythmDB_;
+typedef struct RhythmDB_ RhythmDB;
+
 #define RHYTHMDB_TYPE      (rhythmdb_get_type ())
 #define RHYTHMDB(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RHYTHMDB_TYPE, RhythmDB))
 #define RHYTHMDB_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), RHYTHMDB_TYPE, RhythmDBClass))
@@ -47,16 +50,23 @@
 #define RHYTHMDB_ENTRY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RHYTHMDB_TYPE_ENTRY, RhythmDBEntry))
 #define RHYTHMDB_IS_ENTRY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), RHYTHMDB_TYPE_ENTRY))
 
-typedef GPtrArray RhythmDBQuery;
-GType rhythmdb_query_get_type (void);
-#define RHYTHMDB_TYPE_QUERY	(rhythmdb_query_get_type ())
-#define RHYTHMDB_QUERY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RHYTHMDB_TYPE_QUERY, RhythmDBQuery))
-#define RHYTHMDB_IS_QUERY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), RHYTHMDB_TYPE_QUERY))
+
+typedef void (*RhythmDBEntryActionFunc) (RhythmDBEntry *entry, gpointer data);
+typedef char* (*RhythmDBEntryStringFunc) (RhythmDBEntry *entry, gpointer data);
 
 typedef struct {
 	/* virtual functions here */
-	void (*post_entry_create) (RhythmDBEntry *entry);
-	void (*pre_entry_destroy) (RhythmDBEntry *entry);
+	RhythmDBEntryActionFunc		post_entry_create;
+	gpointer			post_entry_create_data;
+	GDestroyNotify			post_entry_create_destroy;
+
+	RhythmDBEntryActionFunc		pre_entry_destroy;
+	gpointer			pre_entry_destroy_data;
+	GDestroyNotify			pre_entry_destroy_destroy;
+
+	RhythmDBEntryStringFunc		get_playback_uri;
+	gpointer			get_playback_uri_data;
+	GDestroyNotify			get_playback_uri_destroy;
 } RhythmDBEntryType_;
 typedef RhythmDBEntryType_ *RhythmDBEntryType;
 
@@ -65,6 +75,15 @@
 #define RHYTHMDB_ENTRY_TYPE(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), RHYTHMDB_TYPE_ENTRY_TYPE, RhythmDBEntryType_))
 #define RHYTHMDB_IS_ENTRY_TYPE(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), RHYTHMDB_TYPE_ENTRY_TYPE))
 
+
+
+typedef GPtrArray RhythmDBQuery;
+GType rhythmdb_query_get_type (void);
+#define RHYTHMDB_TYPE_QUERY	(rhythmdb_query_get_type ())
+#define RHYTHMDB_QUERY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RHYTHMDB_TYPE_QUERY, RhythmDBQuery))
+#define RHYTHMDB_IS_QUERY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), RHYTHMDB_TYPE_QUERY))
+
+
 #define RHYTHMDB_ENTRY_TYPE_SONG (rhythmdb_entry_song_get_type ())
 #define RHYTHMDB_ENTRY_TYPE_IRADIO_STATION (rhythmdb_entry_iradio_get_type ())
 #define RHYTHMDB_ENTRY_TYPE_PODCAST_POST (rhythmdb_entry_podcast_post_get_type ())
@@ -207,12 +226,12 @@
 
 typedef struct RhythmDBPrivate RhythmDBPrivate;
 
-typedef struct
+struct RhythmDB_
 {
 	GObject parent;
 
 	RhythmDBPrivate *priv;
-} RhythmDB;
+};
 
 typedef struct
 {
@@ -256,6 +275,7 @@
 						 gboolean *cancel);
 } RhythmDBClass;
 
+
 GType		rhythmdb_get_type	(void);
 
 RhythmDB *	rhythmdb_new		(const char *name);
@@ -286,6 +306,8 @@
 						 guint propid, const GValue *value);
 void		rhythmdb_entry_set_uninserted   (RhythmDB *db, RhythmDBEntry *entry,
 						 guint propid, const GValue *value);
+
+char *		rhythmdb_entry_get_playback_uri	(RhythmDBEntry *entry);
 
 void		rhythmdb_entry_delete	(RhythmDB *db, RhythmDBEntry *entry);
 void            rhythmdb_entry_delete_by_type (RhythmDB *db, 
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.237
diff -u -u -r1.237 rb-shell-player.c
--- shell/rb-shell-player.c	20 Apr 2006 20:43:29 -0000	1.237
+++ shell/rb-shell-player.c	26 Apr 2006 11:47:25 -0000
@@ -1029,16 +1029,17 @@
 static gboolean
 rb_shell_player_open_entry (RBShellPlayer *player, RhythmDBEntry *entry, GError **error)
 {
-	RhythmDBEntryType type;
-	const char *location;
+	char *location;
+	gboolean result;
 
-	type = rhythmdb_entry_get_entry_type (entry);
-	if (type == RHYTHMDB_ENTRY_TYPE_PODCAST_POST)
-		location = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MOUNTPOINT);
-	else
-		location = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION);
+	location = rhythmdb_entry_get_playback_uri (entry);
+	if (location == NULL)
+		return FALSE;
 
-	return rb_shell_player_open_location (player, location, error);
+	result = rb_shell_player_open_location (player, location, error);
+	g_free (location);
+
+	return result;
 }
 
 
