Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 6ccd54b51cfad26ef21a8a9a31c6e5dd57794993 Mon Sep 17 00:00:00 2001
- From: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>
- Date: Tue, 11 Oct 2011 15:12:08 +0100
- Subject: [PATCH 1/3] player: force reset of text bit in playing flags
- It turns out that the playbin2 implementation applies no changes to
- the pipeline when you're setting the "suburi" or "current-text"
- properties. The changes are only applied when the pipeline is
- reconfigured. One way to reconfigure the pipeline is to touch the
- playing flags.
- This patch wrap the manipulation of these properties around a get/set
- of the "flags" property to force the reconfiguration of the pipeline.
- ---
- clutter-gst/clutter-gst-player.c | 22 +++++++++++++++++++---
- 1 files changed, 19 insertions(+), 3 deletions(-)
- diff --git a/clutter-gst/clutter-gst-player.c b/clutter-gst/clutter-gst-player.c
- index 9f4ecf5..196c981 100644
- --- a/clutter-gst/clutter-gst-player.c
- +++ b/clutter-gst/clutter-gst-player.c
- @@ -408,13 +408,18 @@ set_subtitle_uri (ClutterGstPlayer *player,
- const gchar *uri)
- {
- ClutterGstPlayerPrivate *priv = PLAYER_GET_PRIVATE (player);
- + GstPlayFlags flags;
- if (!priv->pipeline)
- return;
- CLUTTER_GST_NOTE (MEDIA, "setting subtitle URI: %s", uri);
- + g_object_get (priv->pipeline, "flags", &flags, NULL);
- +
- g_object_set (priv->pipeline, "suburi", uri, NULL);
- +
- + g_object_set (priv->pipeline, "flags", flags, NULL);
- }
- static void
- @@ -1835,6 +1840,7 @@ clutter_gst_player_set_subtitle_track_impl (ClutterGstPlayer *player,
- gint index_)
- {
- ClutterGstPlayerPrivate *priv;
- + GstPlayFlags flags;
- priv = PLAYER_GET_PRIVATE (player);
- @@ -1843,9 +1849,19 @@ clutter_gst_player_set_subtitle_track_impl (ClutterGstPlayer *player,
- CLUTTER_GST_NOTE (SUBTITLES, "set subtitle track to #%d", index_);
- - g_object_set (G_OBJECT (priv->pipeline),
- - "current-text", index_,
- - NULL);
- + g_object_get (priv->pipeline, "flags", &flags, NULL);
- + flags &= ~GST_PLAY_FLAG_TEXT;
- + g_object_set (priv->pipeline, "flags", flags, NULL);
- +
- + if (index_ >= 0)
- + {
- + g_object_set (G_OBJECT (priv->pipeline),
- + "current-text", index_,
- + NULL);
- +
- + flags |= GST_PLAY_FLAG_TEXT;
- + g_object_set (priv->pipeline, "flags", flags, NULL);
- + }
- }
- static gboolean
- --
- 1.7.6.3
Add Comment
Please, Sign In to add comment