[totem] Bug 582316 – Totem doesn't load automatically subtitle if it has spaces



commit cad9c9897fbdc2957936c7ad1aeeb88913e2ba6b
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 13 13:18:26 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 8566fcc..f509d52 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-07  Bastien Nocera  <hadess hadess net>
 
 	* src/backend/bacon-video-widget-gst-0.10.c
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]