[totem/gnome-2-26] Bug 582316 – Totem doesn't load automatically subtitle if it has spaces



commit 38b786853953e1c0214a826df8116e374b2a1445
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 13 13:24:03 2009 +0100

    Bug 582316 â?? Totem doesn't load automatically subtitle if it has spaces
    
    2009-05-13  Bastien Nocera  <hadess hadess net>
    
    	* src/totem-uri.c (totem_uri_get_cached_subtitle_for_uri):
    	Fix loading subtitles from the cache when the filename contains
    	characters that need to be escaped (Closes: #582316)
---
 ChangeLog       |    6 ++++++
 src/totem-uri.c |    9 +++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5aef8d6..0235fc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-13  Bastien Nocera  <hadess hadess net>
+
+	* src/totem-uri.c (totem_uri_get_cached_subtitle_for_uri):
+	Fix loading subtitles from the cache when the filename contains
+	characters that need to be escaped (Closes: #582316) 
+
 2009-05-13  Jan Schmidt  <thaytan noraisin net>
 
 	* src/backend/bacon-video-widget-gst-0.10.c (bvw_element_msg_sync):
diff --git a/src/totem-uri.c b/src/totem-uri.c
index 137865c..0b5ff33 100644
--- a/src/totem-uri.c
+++ b/src/totem-uri.c
@@ -370,9 +370,14 @@ totem_uri_get_subtitle_in_subdir (GFile *file, const char *subdir)
 static char *
 totem_uri_get_cached_subtitle_for_uri (const char *uri)
 {
-	char *basename, *fake_filename, *fake_uri, *ret;
+	char *filename, *basename, *fake_filename, *fake_uri, *ret;
 
-	basename = g_path_get_basename (uri);
+	filename = g_filename_from_uri (uri, NULL, NULL);
+	if (filename == NULL)
+		return NULL;
+
+	basename = g_path_get_basename (filename);
+	g_free (filename);
 	if (basename == NULL || strcmp (basename, ".") == 0) {
 		g_free (basename);
 		return NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]