[totem/gnome-2-28] Fix stream tags leaking into next played file on error



commit 323d1c329f5aa7b1b98feb41575ade65c3cf195e
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Nov 13 13:24:18 2009 +0000

    Fix stream tags leaking into next played file on error
    
    When an error occurs during playback, we only clear the
    tags when we have a new source element, which might happen
    after we've tried to play a new file.
    
    We should always clear the tags on _close() instead.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=536896

 src/backend/bacon-video-widget-gst-0.10.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index f72324c..cca11a9 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -2096,20 +2096,6 @@ playbin_source_notify_cb (GObject *play, GParamSpec *p, BaconVideoWidget *bvw)
   BaconVideoWidgetPrivate *priv = bvw->priv;
   GstElement *source = NULL;
 
-  /* CHECKME: do we really need these taglist frees here (tpm)? */
-  if (bvw->priv->tagcache) {
-    gst_tag_list_free (bvw->priv->tagcache);
-    bvw->priv->tagcache = NULL;
-  }
-  if (bvw->priv->audiotags) {
-    gst_tag_list_free (bvw->priv->audiotags);
-    bvw->priv->audiotags = NULL;
-  }
-  if (bvw->priv->videotags) {
-    gst_tag_list_free (bvw->priv->videotags);
-    bvw->priv->videotags = NULL;
-  }
-
   g_object_get (play, "source", &source, NULL);
 
   if (priv->source != NULL) {
@@ -2119,7 +2105,7 @@ playbin_source_notify_cb (GObject *play, GParamSpec *p, BaconVideoWidget *bvw)
   priv->source = source;
   if (source == NULL)
     return;
-    
+
   GST_DEBUG ("Got source of type %s", G_OBJECT_TYPE_NAME (source));
   bvw_set_device_on_element (bvw, source);
   bvw_set_user_agent_on_element (bvw, source);
@@ -3631,6 +3617,19 @@ bacon_video_widget_close (BaconVideoWidget * bvw)
   bvw->priv->is_live = FALSE;
   bvw->priv->window_resized = FALSE;
 
+  if (bvw->priv->tagcache) {
+    gst_tag_list_free (bvw->priv->tagcache);
+    bvw->priv->tagcache = NULL;
+  }
+  if (bvw->priv->audiotags) {
+    gst_tag_list_free (bvw->priv->audiotags);
+    bvw->priv->audiotags = NULL;
+  }
+  if (bvw->priv->videotags) {
+    gst_tag_list_free (bvw->priv->videotags);
+    bvw->priv->videotags = NULL;
+  }
+
   g_object_notify (G_OBJECT (bvw), "seekable");
   g_signal_emit (bvw, bvw_signals[SIGNAL_CHANNELS_CHANGE], 0);
   got_time_tick (GST_ELEMENT (bvw->priv->play), 0, bvw);



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