[totem] thumbnailer: Remove totem-disc usage



commit 198d7f251e7816f837378fb2081829188847b916
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Aug 24 04:49:57 2013 +0200

    thumbnailer: Remove totem-disc usage
    
    It was removed from totem-pl-parser for GNOME 3.10.

 src/totem-video-thumbnailer.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index 0a139c8..e2edf33 100644
--- a/src/totem-video-thumbnailer.c
+++ b/src/totem-video-thumbnailer.c
@@ -34,7 +34,7 @@
 #include <glib/gi18n.h>
 #include <cairo.h>
 #include <gst/gst.h>
-#include <totem-disc.h>
+#include <totem-pl-parser.h>
 
 #include <errno.h>
 #include <unistd.h>
@@ -89,11 +89,21 @@ typedef struct {
 static void save_pixbuf (GdkPixbuf *pixbuf, const char *path,
                         const char *video_path, int size, gboolean is_still);
 
+static void
+entry_parsed_cb (TotemPlParser *parser,
+                const char    *uri,
+                GHashTable    *metadata,
+                char         **new_url)
+{
+       *new_url = g_strdup (uri);
+}
+
 static char *
 get_special_url (GFile *file)
 {
        char *path, *orig_uri, *uri, *mime_type;
-       TotemDiscMediaType type;
+       TotemPlParser *parser;
+       TotemPlParserResult res;
 
        path = g_file_get_path (file);
 
@@ -107,11 +117,17 @@ get_special_url (GFile *file)
 
        uri = NULL;
        orig_uri = g_file_get_uri (file);
-       type = totem_cd_detect_type_with_url (orig_uri, &uri, NULL);
+
+       parser = totem_pl_parser_new ();
+       g_signal_connect (parser, "entry-parsed",
+                         G_CALLBACK (entry_parsed_cb), &uri);
+
+       res = totem_pl_parser_parse (parser, orig_uri, FALSE);
+
        g_free (orig_uri);
+       g_object_unref (parser);
 
-       if (type == MEDIA_TYPE_DVD ||
-           type == MEDIA_TYPE_VCD)
+       if (res == TOTEM_PL_PARSER_RESULT_SUCCESS)
                return uri;
 
        g_free (uri);


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