[totem] backend: Use scaletempo instead of soundpitch plugin
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] backend: Use scaletempo instead of soundpitch plugin
- Date: Thu, 25 Oct 2012 14:00:16 +0000 (UTC)
commit dd3e22047dbd8c0de06de28572682d8dd76cf691
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 4503883..c6ea562 100644
--- a/configure.in
+++ b/configure.in
@@ -183,8 +183,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 b3247a5..7c505a6 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -3868,7 +3868,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;
@@ -4030,7 +4029,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);
}
@@ -5897,7 +5895,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 {
@@ -5919,7 +5916,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 {
@@ -5971,7 +5967,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");
@@ -6066,7 +6062,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",
@@ -6182,9 +6177,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]