[Xfce4-commits] <parole:master> Don't blindly so here just do that for content video types.
Ali Abdallah
noreply at xfce.org
Thu Nov 19 21:02:02 CET 2009
Updating branch refs/heads/master
to 4f5fcf8e5c3fd164320ba90fe7acbdd981058691 (commit)
from b53691c45b654224203346811f01f1b0ba6cf2f8 (commit)
commit 4f5fcf8e5c3fd164320ba90fe7acbdd981058691
Author: Ali Abdallah <ali at ali-xfce.org>
Date: Thu Nov 19 13:04:49 2009 +0100
Don't blindly so here just do that for content video types.
parole/parole-player.c | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/parole/parole-player.c b/parole/parole-player.c
index 9744b1e..485c081 100644
--- a/parole/parole-player.c
+++ b/parole/parole-player.c
@@ -46,6 +46,7 @@
#include "parole-dbus.h"
#include "parole-mediachooser.h"
#include "parole-file.h"
+#include "parole-filters.h"
#include "parole-disc.h"
#include "parole-disc-menu.h"
#include "parole-statusbar.h"
@@ -202,7 +203,7 @@ struct ParolePlayerPrivate
#ifdef HAVE_XF86_KEYSYM
ParoleButton *button;
#endif
-
+ GtkFileFilter *video_filter;
GtkRecentManager *recent;
GtkWidget *gst;
@@ -369,24 +370,28 @@ parole_player_media_activated_cb (ParoleMediaList *list, GtkTreeRowReference *ro
if ( file )
{
- /*
gchar *sub = NULL;
+ const gchar *uri;
+
+ uri = parole_file_get_uri (file);
+ TRACE ("File content type %s", parole_file_get_content_type (file));
if ( g_str_has_prefix (uri, "file:/") )
{
-
+ if (parole_file_filter (player->priv->video_filter, file) )
+ {
+ sub = parole_get_subtitle_path (uri);
+ if ( sub )
+ TRACE ("With subtitle file path %s", sub);
+ }
}
- TRACE ("File content type %s", parole_file_get_content_type (file));
- */
-
- TRACE ("Trying to play media file %s", parole_file_get_uri (file));
gtk_widget_set_sensitive (player->priv->stop, TRUE);
parole_gst_play_uri (PAROLE_GST (player->priv->gst),
parole_file_get_uri (file),
- NULL);//FIXME, load subtitles
-
+ sub);
+ g_free (sub);
gtk_widget_grab_focus (player->priv->gst);
g_object_unref (file);
}
@@ -1329,6 +1334,7 @@ parole_player_finalize (GObject *object)
g_object_unref (player->priv->disc_menu);
g_object_unref (player->priv->conf);
g_object_unref (player->priv->screen_saver);
+ g_object_unref (player->priv->video_filter);
#ifdef HAVE_XF86_KEYSYM
g_object_unref (player->priv->button);
@@ -1653,6 +1659,9 @@ parole_player_init (ParolePlayer *player)
player->priv = PAROLE_PLAYER_GET_PRIVATE (player);
+ player->priv->video_filter = parole_get_supported_video_filter ();
+ g_object_ref_sink (player->priv->video_filter);
+
builder = parole_builder_get_main_interface ();
player->priv->conf = parole_conf_new ();
More information about the Xfce4-commits
mailing list