[totem-pl-parser] lib: Fix *.ts files being ignored



commit 374a4b782956bfc953c9b4b8cc3eae5a30414d92
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jun 15 14:22:46 2012 +0100

    lib: Fix *.ts files being ignored
    
    The magic for the MP2T file is far too restrictive, and doesn't
    match a huge number of media files. When we see *.ts files, assume
    they're MP2T files instead of Qt Linguist translations.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678163

 plparse/totem-pl-parser.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index 6060c29..1a8b093 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1826,6 +1826,12 @@ totem_pl_parser_parse_internal (TotemPlParser *parser,
 		g_free (uri);
 	}
 
+	/* We're much more likely to have an MP2T file instead */
+	if (g_strcmp0 (mimetype, "application/x-linguist") == 0) {
+		g_free (mimetype);
+		mimetype = g_strdup ("video/mp2t");
+	}
+
 	DEBUG(file, g_print ("_get_mime_type_for_name for '%s' returned '%s'\n", uri, mimetype));
 	if (mimetype == NULL || strcmp (UNKNOWN_TYPE, mimetype) == 0
 	    || (g_file_is_native (file) && g_content_type_is_a (mimetype, "text/plain") != FALSE)) {



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