[totem/gnome-3-6] backend: Use scaletempo instead of soundpitch plugin



commit 74a993f9487e3967ce59f38a0691b6f6b5ec35cd
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Oct 25 10:57:24 2012 +0200

    backend: Use scaletempo instead of soundpitch plugin
    
    The soundpitch plugin is irreparably broken, and the scaletempo
    offers the same features without the bugs, or the need to change
    the pitch ratio ourselves.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686391

 configure.in                     |    6 ++++--
 src/backend/bacon-video-widget.c |   10 +---------
 2 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/configure.in b/configure.in
index 2dd0326..eb6bb8e 100644
--- a/configure.in
+++ b/configure.in
@@ -181,8 +181,10 @@ done
 
 dnl Check for elements from gst-plugins-bad
 dnl Set plugins which contain below elements
-set -- soundtouch
-for bad_element in pitch
+PKG_CHECK_MODULES(GST_PLUGINS_BAD, gstreamer-plugins-bad-1.0 >= 1.0.2)
+
+set -- scaletempo
+for bad_element in scaletempo
 do
 	AC_MSG_CHECKING([GStreamer 1.0 $bad_element element])
 	if $gst10_inspect $bad_element >/dev/null 2>/dev/null; then
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index b488cde..99bc075 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -3864,7 +3864,6 @@ bacon_video_widget_close (BaconVideoWidget * bvw)
   bvw->priv->has_angles = FALSE;
   bvw->priv->window_resized = FALSE;
   bvw->priv->rate = FORWARD_RATE;
-  g_object_set (bvw->priv->audio_pitchcontrol, "pitch", 1.0, NULL);
 
   bvw->priv->current_time = 0;
   bvw->priv->seek_req_time = GST_CLOCK_TIME_NONE;
@@ -4026,7 +4025,6 @@ bacon_video_widget_dvd_event (BaconVideoWidget * bvw,
         gst_element_seek (bvw->priv->play, FORWARD_RATE, fmt, GST_SEEK_FLAG_FLUSH,
             GST_SEEK_TYPE_SET, val, GST_SEEK_TYPE_NONE, G_GINT64_CONSTANT (0));
 	bvw->priv->rate = FORWARD_RATE;
-        g_object_set (bvw->priv->audio_pitchcontrol, "pitch", 1.0, NULL);
       } else {
         GST_DEBUG ("failed to query position (%s)", fmt_name);
       }
@@ -5893,7 +5891,6 @@ bvw_set_playback_direction (BaconVideoWidget *bvw, gboolean forward)
       } else {
 	gst_element_get_state (bvw->priv->play, NULL, NULL, GST_CLOCK_TIME_NONE);
 	bvw->priv->rate = REVERSE_RATE;
-	g_object_set (bvw->priv->audio_pitchcontrol, "pitch", 1.0, NULL);
 	retval = TRUE;
       }
     } else {
@@ -5915,7 +5912,6 @@ bvw_set_playback_direction (BaconVideoWidget *bvw, gboolean forward)
       } else {
 	gst_element_get_state (bvw->priv->play, NULL, NULL, GST_CLOCK_TIME_NONE);
 	bvw->priv->rate = FORWARD_RATE;
-	g_object_set (bvw->priv->audio_pitchcontrol, "pitch", 1.0, NULL);
 	retval = TRUE;
       }
     } else {
@@ -5967,7 +5963,7 @@ bacon_video_widget_initable_init (GInitable     *initable,
 
   /* Instantiate all the fallible plugins */
   bvw->priv->play = element_make_or_warn ("playbin", "play");
-  bvw->priv->audio_pitchcontrol = element_make_or_warn ("pitch", "audiopitch");
+  bvw->priv->audio_pitchcontrol = element_make_or_warn ("pitch", "scaletempo");
   video_sink = element_make_or_warn ("cluttersink", "video-sink");
   audio_sink = element_make_or_warn ("autoaudiosink", "audio-sink");
 
@@ -6062,7 +6058,6 @@ bacon_video_widget_initable_init (GInitable     *initable,
   bvw->priv->audio_capsfilter =
     gst_element_factory_make ("capsfilter", "audiofilter");
   audio_bin = gst_bin_new ("audiosinkbin");
-  g_object_set (bvw->priv->audio_pitchcontrol, "pitch", 1.0, NULL);
   gst_bin_add_many (GST_BIN (audio_bin), bvw->priv->audio_capsfilter,
 		    bvw->priv->audio_pitchcontrol, audio_sink, NULL);
   gst_element_link_pads (bvw->priv->audio_capsfilter, "src",
@@ -6178,9 +6173,6 @@ bacon_video_widget_set_rate (BaconVideoWidget *bvw,
     } else {
       gst_element_get_state (bvw->priv->play, NULL, NULL, GST_CLOCK_TIME_NONE);
       bvw->priv->rate = new_rate;
-      g_object_get (bvw->priv->audio_pitchcontrol, "pitch", &pitch, NULL);
-      g_object_set (bvw->priv->audio_pitchcontrol, "pitch", pitch / ratio, NULL);
-      GST_DEBUG ("changed rate to %f, pitch to %f\n", new_rate, pitch);
       retval = TRUE;
     }
   } else {



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