diff -u -u -r1.12 general-prefs.glade
--- data/glade/general-prefs.glade	18 Feb 2006 06:56:17 -0000	1.12
+++ data/glade/general-prefs.glade	20 Mar 2006 05:44:57 -0000
@@ -390,6 +390,29 @@
 				  <property name="y_options"></property>
 				</packing>
 			      </child>
+
+			      <child>
+				<widget class="GtkCheckButton" id="mime_type_check">
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="label" translatable="yes">_Type</property>
+				  <property name="use_underline">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+				  <property name="active">False</property>
+				  <property name="inconsistent">False</property>
+				  <property name="draw_indicator">True</property>
+				  <signal name="toggled" handler="rb_shell_preferences_column_check_changed_cb" last_modification_time="Fri, 02 May 2003 04:26:32 GMT"/>
+				</widget>
+				<packing>
+				  <property name="left_attach">1</property>
+				  <property name="right_attach">2</property>
+				  <property name="top_attach">5</property>
+				  <property name="bottom_attach">6</property>
+				  <property name="x_options">fill</property>
+				  <property name="y_options"></property>
+				</packing>
+			      </child>
 			    </widget>
 			    <packing>
 			      <property name="padding">0</property>
diff -u -u -r1.35 song-info.glade
--- data/glade/song-info.glade	5 Nov 2005 05:03:17 -0000	1.35
+++ data/glade/song-info.glade	20 Mar 2006 05:44:57 -0000
@@ -460,7 +460,7 @@
 	<widget class="GtkTable" id="song_info_additional">
 	  <property name="border_width">12</property>
 	  <property name="visible">True</property>
-	  <property name="n_rows">10</property>
+	  <property name="n_rows">11</property>
 	  <property name="n_columns">2</property>
 	  <property name="homogeneous">False</property>
 	  <property name="row_spacing">6</property>
@@ -588,58 +588,106 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="bitrate_label">
+	    <widget class="GtkEntry" id="song_info_name">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Bitrate:</property>
-	      <property name="use_underline">False</property>
+	      <property name="can_focus">True</property>
+	      <property name="editable">False</property>
+	      <property name="visibility">True</property>
+	      <property name="max_length">0</property>
+	      <property name="text" translatable="yes"></property>
+	      <property name="has_frame">True</property>
+	      <property name="invisible_char">*</property>
+	      <property name="activates_default">False</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">0</property>
+	      <property name="bottom_attach">1</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="song_info_rating_container">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<placeholder/>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">9</property>
+	      <property name="bottom_attach">10</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="rating_label">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Rating:</property>
+	      <property name="use_underline">True</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
 	      <property name="selectable">False</property>
 	      <property name="xalign">0</property>
-	      <property name="yalign">0.5</property>
+	      <property name="yalign">0</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
 	      <property name="right_attach">1</property>
-	      <property name="top_attach">3</property>
-	      <property name="bottom_attach">4</property>
+	      <property name="top_attach">10</property>
+	      <property name="bottom_attach">11</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="song_info_bitrate">
+	    <widget class="GtkLabel" id="label119">
 	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes"></property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
-	      <property name="selectable">True</property>
+	      <property name="selectable">False</property>
 	      <property name="xalign">0</property>
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
-	      <property name="left_attach">1</property>
-	      <property name="right_attach">2</property>
-	      <property name="top_attach">3</property>
-	      <property name="bottom_attach">4</property>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">9</property>
+	      <property name="bottom_attach">10</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="location_label">
+	    <widget class="GtkLabel" id="play_count_label">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Location:</property>
+	      <property name="label" translatable="yes">Play count:</property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -649,21 +697,25 @@
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
 	      <property name="right_attach">1</property>
-	      <property name="top_attach">4</property>
-	      <property name="bottom_attach">5</property>
+	      <property name="top_attach">8</property>
+	      <property name="bottom_attach">9</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="label117">
+	    <widget class="GtkLabel" id="last_played_label">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes"></property>
+	      <property name="label" translatable="yes">Last played:</property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -673,21 +725,25 @@
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
 	      <property name="right_attach">1</property>
-	      <property name="top_attach">5</property>
-	      <property name="bottom_attach">6</property>
+	      <property name="top_attach">7</property>
+	      <property name="bottom_attach">8</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="last_played_label">
+	    <widget class="GtkLabel" id="label117">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Last played:</property>
+	      <property name="label" translatable="yes"></property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -709,34 +765,37 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="song_info_lastplayed">
+	    <widget class="GtkLabel" id="location_label">
 	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label" translatable="yes"></property>
+	      <property name="label" translatable="yes">Location:</property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
-	      <property name="selectable">True</property>
+	      <property name="selectable">False</property>
 	      <property name="xalign">0</property>
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
-	      <property name="left_attach">1</property>
-	      <property name="right_attach">2</property>
-	      <property name="top_attach">6</property>
-	      <property name="bottom_attach">7</property>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">5</property>
+	      <property name="bottom_attach">6</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="play_count_label">
+	    <widget class="GtkLabel" id="bitrate_label">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Play count:</property>
+	      <property name="label" translatable="yes">Bitrate:</property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -746,59 +805,71 @@
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
 	      <property name="right_attach">1</property>
-	      <property name="top_attach">7</property>
-	      <property name="bottom_attach">8</property>
+	      <property name="top_attach">4</property>
+	      <property name="bottom_attach">5</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="song_info_playcount">
+	    <widget class="GtkLabel" id="label120">
 	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes"></property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
-	      <property name="selectable">True</property>
+	      <property name="selectable">False</property>
 	      <property name="xalign">0</property>
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
 	      <property name="right_attach">2</property>
-	      <property name="top_attach">7</property>
-	      <property name="bottom_attach">8</property>
+	      <property name="top_attach">9</property>
+	      <property name="bottom_attach">10</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="label119">
+	    <widget class="GtkLabel" id="song_info_playcount">
 	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes"></property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
+	      <property name="selectable">True</property>
 	      <property name="xalign">0</property>
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
-	      <property name="left_attach">0</property>
-	      <property name="right_attach">1</property>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
 	      <property name="top_attach">8</property>
 	      <property name="bottom_attach">9</property>
 	      <property name="x_options">fill</property>
@@ -807,24 +878,29 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="label120">
+	    <widget class="GtkLabel" id="song_info_lastplayed">
 	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes"></property>
 	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
+	      <property name="selectable">True</property>
 	      <property name="xalign">0</property>
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
 	      <property name="right_attach">2</property>
-	      <property name="top_attach">8</property>
-	      <property name="bottom_attach">9</property>
+	      <property name="top_attach">7</property>
+	      <property name="bottom_attach">8</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
@@ -845,74 +921,95 @@
 	    <packing>
 	      <property name="left_attach">1</property>
 	      <property name="right_attach">2</property>
-	      <property name="top_attach">4</property>
-	      <property name="bottom_attach">5</property>
+	      <property name="top_attach">5</property>
+	      <property name="bottom_attach">6</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkEntry" id="song_info_name">
+	    <widget class="GtkLabel" id="song_info_bitrate">
 	      <property name="visible">True</property>
 	      <property name="can_focus">True</property>
-	      <property name="editable">False</property>
-	      <property name="visibility">True</property>
-	      <property name="max_length">0</property>
-	      <property name="text" translatable="yes"></property>
-	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
-	      <property name="activates_default">False</property>
+	      <property name="label" translatable="yes"></property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">True</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
 	      <property name="right_attach">2</property>
-	      <property name="top_attach">0</property>
-	      <property name="bottom_attach">1</property>
+	      <property name="top_attach">4</property>
+	      <property name="bottom_attach">5</property>
+	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="rating_label">
+	    <widget class="GtkLabel" id="type_label">
 	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">_Rating:</property>
-	      <property name="use_underline">True</property>
+	      <property name="label" translatable="yes">Type:</property>
+	      <property name="use_underline">False</property>
 	      <property name="use_markup">False</property>
 	      <property name="justify">GTK_JUSTIFY_LEFT</property>
 	      <property name="wrap">False</property>
 	      <property name="selectable">False</property>
 	      <property name="xalign">0</property>
-	      <property name="yalign">0</property>
+	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
 	      <property name="right_attach">1</property>
-	      <property name="top_attach">9</property>
-	      <property name="bottom_attach">10</property>
+	      <property name="top_attach">3</property>
+	      <property name="bottom_attach">4</property>
 	      <property name="x_options">fill</property>
 	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkHBox" id="song_info_rating_container">
+	    <widget class="GtkLabel" id="song_info_type">
 	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">0</property>
-
-	      <child>
-		<placeholder/>
-	      </child>
+	      <property name="can_focus">True</property>
+	      <property name="label" translatable="yes"></property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">True</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
 	      <property name="right_attach">2</property>
-	      <property name="top_attach">9</property>
-	      <property name="bottom_attach">10</property>
+	      <property name="top_attach">3</property>
+	      <property name="bottom_attach">4</property>
 	      <property name="x_options">fill</property>
-	      <property name="y_options">fill</property>
+	      <property name="y_options"></property>
 	    </packing>
 	  </child>
 	</widget>
diff -u -u -r1.19 rb-util.c
--- lib/rb-util.c	7 Feb 2006 13:19:56 -0000	1.19
+++ lib/rb-util.c	20 Mar 2006 05:44:57 -0000
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnomevfs/gnome-vfs.h>
+#include <libgnomevfs/gnome-vfs-mime-handlers.h>
 #include "rb-debug.h"
 
 static GPrivate * private_is_primary_thread;
@@ -565,6 +566,22 @@
 		str = g_strdup_printf (_("%d:%02d:%02d"), hours, minutes, seconds);
 
 	return str;
+}
+
+const gchar*
+rb_mime_get_friendly_name (const gchar *mime_type)
+{
+	const gchar *name = NULL;
+	
+	/* gstreamer returns this for ID3 tagged files */
+	if (strcmp (mime_type, "application/x-id3") == 0)
+		name = _("ID3-tagged audio");
+	if (name == NULL && mime_type)
+		name = gnome_vfs_mime_get_description (mime_type);
+	if (name == NULL)
+		name = _("Unknown");
+
+	return name;
 }
 
 gboolean
diff -u -u -r1.15 rb-util.h
--- lib/rb-util.h	7 Feb 2006 13:19:56 -0000	1.15
+++ lib/rb-util.h	20 Mar 2006 05:44:57 -0000
@@ -59,6 +59,8 @@
 GList* rb_collate_hash_table_keys (GHashTable *table);
 GList* rb_collate_hash_table_values (GHashTable *table);
 
+const gchar* rb_mime_get_friendly_name (const gchar *mime_type);
+
 G_END_DECLS
 
 #endif /* __RB_UTIL_H */
diff -u -u -r1.64 rb-metadata-gst.c
--- metadata/rb-metadata-gst.c	12 Mar 2006 08:56:22 -0000	1.64
+++ metadata/rb-metadata-gst.c	20 Mar 2006 05:44:58 -0000
@@ -75,6 +75,7 @@
 	GstElement *pipeline;
 	GstElement *sink;
 	gulong typefind_cb_id;
+	GstPad *decoder_sink_pad;
 
 	/* Array of RBMetadataGstType */
 	GPtrArray *supported_types;
@@ -285,6 +286,9 @@
 	if (md->priv->metadata)
 		g_hash_table_destroy (md->priv->metadata);
 
+	if (md->priv->decoder_sink_pad)
+		gst_object_unref (GST_OBJECT (md->priv->decoder_sink_pad));
+	
 	if (md->priv->pipeline)
 		gst_object_unref (GST_OBJECT (md->priv->pipeline));
 
@@ -585,6 +589,15 @@
 
 
 static void
+get_decoder_sink_pad (GstPad *pad, RBMetaData *md)
+{
+	if (md->priv->decoder_sink_pad == NULL)
+		md->priv->decoder_sink_pad = pad;
+	else
+		gst_object_unref (pad);
+}
+
+static void
 rb_metadata_gst_new_decoded_pad_cb (GstElement *decodebin, GstPad *pad, gboolean last, RBMetaData *md)
 {
 	GstCaps *caps;
@@ -606,6 +619,7 @@
 		if (g_str_has_prefix (mimetype, "audio/x-raw")) {
 			/* link this to the fake sink */
 			GstPad *sink_pad;
+			GstElement *decoder;
 			rb_debug ("linking new decoded pad of type %s to fakesink", mimetype);
 			sink_pad = gst_element_get_pad (md->priv->sink, "sink");
 			gst_pad_link (pad, sink_pad);
@@ -613,6 +627,28 @@
 			/* what happens if we get two audio pads from the same stream? 
 			 * can this happen?
 			 */
+
+			/*
+			 * find the element that created the pad, and get its sink pad.
+			 * later on we can use this to determine the actual type of the
+			 * stream.
+			 */
+			if (GST_IS_GHOST_PAD (pad)) {
+				GstPad *real = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
+				decoder = GST_PAD_PARENT (real);
+				gst_object_unref (real);
+			} else {
+				decoder = GST_PAD_PARENT (pad);
+			}
+			if (decoder) {
+				GstIterator *sinkpads;
+
+				sinkpads = gst_element_iterate_sink_pads (decoder);
+				gst_iterator_foreach (sinkpads, (GFunc) get_decoder_sink_pad, md);
+				gst_iterator_free (sinkpads);
+			}
+
+			
 		} else if (g_str_has_prefix (mimetype, "video/")) {
 			rb_debug ("got decoded video pad of type %s", mimetype);
 			md->priv->non_audio = TRUE;
@@ -917,6 +953,28 @@
 			} else {
 				rb_debug ("duration query failed!");
 			}
+		}
+
+		/*
+		 * If we managed to find the decoder's sink pad, the caps on it
+		 * may tell us the actual type of the stream, rather than just the
+		 * container type.
+		 */
+		if (md->priv->decoder_sink_pad) {
+			GstCaps *caps = GST_PAD_CAPS (md->priv->decoder_sink_pad);
+			if (caps) {
+				GstStructure *structure = gst_caps_get_structure (caps, 0);
+				const gchar *realtype = gst_structure_get_name (structure);
+
+				if (realtype != NULL) {
+					if (md->priv->type != NULL)
+						g_free (md->priv->type);
+					md->priv->type = g_strdup (realtype);
+				}
+			}
+
+			gst_object_unref (md->priv->decoder_sink_pad);
+			md->priv->decoder_sink_pad = NULL;
 		}
 	}
 #ifdef HAVE_GSTREAMER_0_8
diff -u -u -r1.110 rhythmdb-query-model.c
--- rhythmdb/rhythmdb-query-model.c	13 Mar 2006 22:04:52 -0000	1.110
+++ rhythmdb/rhythmdb-query-model.c	20 Mar 2006 05:45:02 -0000
@@ -2328,6 +2328,29 @@
 }
 
 gint
+rhythmdb_query_model_mime_sort_func (RhythmDBEntry *a, RhythmDBEntry *b,
+			      RhythmDBQueryModel *model)
+{
+	const char *a_val, *b_val;
+	const char *a_desc = NULL, *b_desc = NULL;
+	gint ret;
+
+	a_val = rhythmdb_entry_get_string (a, RHYTHMDB_PROP_MIMETYPE);
+	b_val = rhythmdb_entry_get_string (b, RHYTHMDB_PROP_MIMETYPE);
+
+	a_desc = rb_mime_get_friendly_name (a_val);
+	b_desc = rb_mime_get_friendly_name (b_val);
+	
+	ret = strcmp (a_desc, b_desc);
+		
+	if (ret != 0)
+		return ret;
+	else
+		return rhythmdb_query_model_artist_sort_func (a, b, model);
+}
+
+
+gint
 rhythmdb_query_model_string_sort_func (RhythmDBEntry *a, RhythmDBEntry *b,
 				       RhythmDBQueryModel *model)
 {
diff -u -u -r1.24 rhythmdb-query-model.h
--- rhythmdb/rhythmdb-query-model.h	18 Feb 2006 09:47:12 -0000	1.24
+++ rhythmdb/rhythmdb-query-model.h	20 Mar 2006 05:45:02 -0000
@@ -132,6 +132,9 @@
 
 gint 			rhythmdb_query_model_date_sort_func (RhythmDBEntry *a, RhythmDBEntry *b,
 							     RhythmDBQueryModel *model);
+
+gint 			rhythmdb_query_model_mime_sort_func (RhythmDBEntry *a, RhythmDBEntry *b,
+							     RhythmDBQueryModel *model);
 G_END_DECLS
 
 #endif /* __RHYTHMDB_QUERY_MODEL_H */
diff -u -u -r1.57 rb-shell-preferences.c
--- shell/rb-shell-preferences.c	18 Feb 2006 06:56:17 -0000	1.57
+++ shell/rb-shell-preferences.c	20 Mar 2006 05:45:03 -0000
@@ -81,6 +81,7 @@
 	GtkWidget *first_seen_check;
 	GtkWidget *quality_check;
 	GtkWidget *year_check;
+	GtkWidget *mime_type_check;
 
 	gboolean loading;
 };
@@ -186,6 +187,8 @@
 		glade_xml_get_widget (xml, "year_check");
 	shell_preferences->priv->first_seen_check =
 		glade_xml_get_widget (xml, "first_seen_check");
+	shell_preferences->priv->mime_type_check =
+		glade_xml_get_widget (xml, "mime_type_check");
 
 	gtk_notebook_append_page (GTK_NOTEBOOK (shell_preferences->priv->notebook),
 				  glade_xml_get_widget (xml, "general_vbox"),
@@ -487,6 +490,8 @@
 		colname = "RHYTHMDB_PROP_BITRATE";
 	else if (butt == GTK_CHECK_BUTTON (shell_preferences->priv->first_seen_check))
 		colname = "RHYTHMDB_PROP_FIRST_SEEN";
+	else if (butt == GTK_CHECK_BUTTON (shell_preferences->priv->mime_type_check))
+		colname = "RHYTHMDB_PROP_MIMETYPE";
 	else
 		g_assert_not_reached ();
 
@@ -574,6 +579,9 @@
 		rb_shell_preferences_sync_column_button (shell_preferences,
 			       				 shell_preferences->priv->quality_check,
 							 columns, "RHYTHMDB_PROP_BITRATE");
+		rb_shell_preferences_sync_column_button (shell_preferences,
+			       				 shell_preferences->priv->mime_type_check,
+							 columns, "RHYTHMDB_PROP_MIMETYPE");
 	}
 
 	g_free (columns);
diff -u -u -r1.155 rb-library-source.c
--- sources/rb-library-source.c	14 Mar 2006 13:28:54 -0000	1.155
+++ sources/rb-library-source.c	20 Mar 2006 05:45:06 -0000
@@ -472,6 +472,7 @@
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_YEAR, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_DURATION, FALSE);
  	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_QUALITY, FALSE);
+ 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_MIMETYPE, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_RATING, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_PLAY_COUNT, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_LAST_PLAYED, FALSE);
diff -u -u -r1.112 rb-playlist-source.c
--- sources/rb-playlist-source.c	22 Feb 2006 13:06:02 -0000	1.112
+++ sources/rb-playlist-source.c	20 Mar 2006 05:45:06 -0000
@@ -262,6 +262,7 @@
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_YEAR, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_DURATION, FALSE);
  	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_QUALITY, FALSE);
+ 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_MIMETYPE, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_RATING, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_PLAY_COUNT, FALSE);
 	rb_entry_view_append_column (source->priv->songs, RB_ENTRY_VIEW_COL_LAST_PLAYED, FALSE);
diff -u -u -r1.135 rb-entry-view.c
--- widgets/rb-entry-view.c	15 Mar 2006 10:40:50 -0000	1.135
+++ widgets/rb-entry-view.c	20 Mar 2006 05:45:09 -0000
@@ -419,7 +419,6 @@
 	G_OBJECT_CLASS (rb_entry_view_parent_class)->finalize (object);
 }
 
-
 static void
 rb_entry_view_set_property (GObject *object,
 			   guint prop_id,
@@ -612,6 +611,23 @@
 }
 
 static void
+rb_entry_view_mime_cell_data_func (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
+				   GtkTreeModel *tree_model, GtkTreeIter *iter,
+				   struct RBEntryViewCellDataFuncData *data)
+{
+	RhythmDBEntry *entry;
+	const char *str;
+
+	entry = rhythmdb_query_model_iter_to_entry (data->view->priv->model, iter);
+
+	str = rhythmdb_entry_get_string (entry, data->propid);
+	str = rb_mime_get_friendly_name (str);
+
+	g_object_set (G_OBJECT (renderer), "text", str, NULL);
+}
+
+
+static void
 rb_entry_view_rating_cell_data_func (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
 				     GtkTreeModel *tree_model, GtkTreeIter *iter,
 				     RBEntryView *view)
@@ -1064,6 +1080,16 @@
 		key = "FirstSeen";
 		strings[0] = title;
 		strings[1] = rb_entry_view_get_time_date_column_sample ();
+		break;
+	case RB_ENTRY_VIEW_COL_MIMETYPE:
+		propid = RHYTHMDB_PROP_MIMETYPE;
+		cell_data->propid = propid;
+		cell_data_func = (GtkTreeCellDataFunc) rb_entry_view_mime_cell_data_func;				
+		sort_propid = RHYTHMDB_PROP_MIMETYPE;
+		sort_func = (GCompareDataFunc) rhythmdb_query_model_mime_sort_func;
+		title = _("T_ype");
+		key = "MimeType";
+		ellipsize = TRUE;
 		break;
 	case RB_ENTRY_VIEW_COL_LAST_SEEN:
 		propid = RHYTHMDB_PROP_LAST_SEEN;
diff -u -u -r1.33 rb-entry-view.h
--- widgets/rb-entry-view.h	2 Mar 2006 12:30:36 -0000	1.33
+++ widgets/rb-entry-view.h	20 Mar 2006 05:45:09 -0000
@@ -55,6 +55,7 @@
 	RB_ENTRY_VIEW_COL_FIRST_SEEN,
 	RB_ENTRY_VIEW_COL_LAST_SEEN,
 	RB_ENTRY_VIEW_COL_LOCATION,
+ 	RB_ENTRY_VIEW_COL_MIMETYPE,
 	RB_ENTRY_VIEW_COL_ERROR
 } RBEntryViewColumn;
 
diff -u -u -r1.55 rb-song-info.c
--- widgets/rb-song-info.c	12 Mar 2006 08:56:23 -0000	1.55
+++ widgets/rb-song-info.c	20 Mar 2006 05:45:09 -0000
@@ -45,6 +45,7 @@
 #include "rb-rating.h"
 #include "rb-preferences.h"
 #include "eel-gconf-extensions.h"
+#include "rb-util.h"
 #include "rb-source.h"
 
 static void rb_song_info_class_init (RBSongInfoClass *klass);
@@ -76,6 +77,7 @@
 static void rb_song_info_update_rating (RBSongInfo *song_info);
 static void rb_song_info_update_year (RBSongInfo *song_info);
 static void rb_song_info_update_playback_error (RBSongInfo *song_info);
+static void rb_song_info_update_mime_type (RBSongInfo *song_info);
 
 static void rb_song_info_backward_clicked_cb (GtkWidget *button,
 					      RBSongInfo *song_info);
@@ -123,6 +125,7 @@
 	GtkWidget   *location;
 	GtkWidget   *play_count;
 	GtkWidget   *last_played;
+	GtkWidget   *mime_type;
 	GtkWidget   *rating;
 
 	RhythmDBPropertyModel* albums;
@@ -262,6 +265,7 @@
 	song_info->priv->location = glade_xml_get_widget (xml, "song_info_location");
 	song_info->priv->play_count    = glade_xml_get_widget (xml, "song_info_playcount");
 	song_info->priv->last_played   = glade_xml_get_widget (xml, "song_info_lastplayed");
+	song_info->priv->mime_type   = glade_xml_get_widget (xml, "song_info_type");
 	song_info->priv->name = glade_xml_get_widget (xml, "song_info_name");
 
 	rb_glade_boldify_label (xml, "title_label");
@@ -272,6 +276,7 @@
 	rb_glade_boldify_label (xml, "play_count_label");
 	rb_glade_boldify_label (xml, "duration_label");
 	rb_glade_boldify_label (xml, "bitrate_label");
+	rb_glade_boldify_label (xml, "type_label");
 
 	/* whenever you press a mnemonic, the associated GtkEntry's text gets highlighted */
 	g_signal_connect_object (G_OBJECT (song_info->priv->title),
@@ -780,6 +785,7 @@
 	rb_song_info_update_duration (song_info);
 	rb_song_info_update_location (song_info);
 	rb_song_info_update_play_count (song_info);
+	rb_song_info_update_mime_type (song_info);
 	rb_song_info_update_last_played (song_info);
 	rb_song_info_update_bitrate (song_info);
 	rb_song_info_update_rating (song_info);
@@ -980,6 +986,22 @@
 	text = g_strdup_printf ("%ld", num);
 	gtk_label_set_text (GTK_LABEL (song_info->priv->play_count), text);
 	g_free (text);
+}
+
+static void
+rb_song_info_update_mime_type (RBSongInfo *song_info)
+{
+	const char *type, *desc;
+	char *str;
+	
+	type = rhythmdb_entry_get_string (song_info->priv->current_entry, RHYTHMDB_PROP_MIMETYPE);
+	desc = rb_mime_get_friendly_name (type);
+	if (!type || !strcmp ("", type))
+		type = _("Unknown");
+
+	str = g_strdup_printf ("%s (%s)", desc, type);
+	gtk_label_set_text (GTK_LABEL (song_info->priv->mime_type), str);
+	g_free (str);
 }
 
 static void
