summaryrefslogtreecommitdiff
path: root/src/totem-video-thumbnailer.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-08-24 04:49:57 +0200
committerBastien Nocera <hadess@hadess.net>2013-08-24 04:50:57 +0200
commit198d7f251e7816f837378fb2081829188847b916 (patch)
tree3acd133ed8edc7fdcf817f4608dd31b532eb3f83 /src/totem-video-thumbnailer.c
parente4b4745efdc60046b51405b77ff8426e162cb3e4 (diff)
downloadtotem-198d7f251e7816f837378fb2081829188847b916.tar.gz
thumbnailer: Remove totem-disc usage
It was removed from totem-pl-parser for GNOME 3.10.
Diffstat (limited to 'src/totem-video-thumbnailer.c')
-rw-r--r--src/totem-video-thumbnailer.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index 0a139c833..e2edf33c8 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);