[banshee/gapless-ng: 836/836] [libbanshee] Handle missing rgvolume element for ReplayGain.
- From: Christopher James Halse Rogers <chrishr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/gapless-ng: 836/836] [libbanshee] Handle missing rgvolume element for ReplayGain.
- Date: Thu, 25 Feb 2010 22:46:09 +0000 (UTC)
commit 5609674fa639416c0783061bd9774cc53e6052c1
Author: Christopher James Halse Rogers <raof ubuntu com>
Date: Thu Feb 25 15:38:37 2010 +1100
[libbanshee] Handle missing rgvolume element for ReplayGain.
If the rgvolume element cannot be loaded, set replaygain_enabled to FALSE to maintain
coherent state.
libbanshee/banshee-player-replaygain.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libbanshee/banshee-player-replaygain.c b/libbanshee/banshee-player-replaygain.c
index 7395dc0..22b171f 100644
--- a/libbanshee/banshee-player-replaygain.c
+++ b/libbanshee/banshee-player-replaygain.c
@@ -94,8 +94,11 @@ pad_block_cb (GstPad *srcPad, gboolean blocked, gpointer user_data) {
if ((player->replaygain_enabled && player->rgvolume_in_pipeline) ||
(!player->replaygain_enabled && !player->rgvolume_in_pipeline)) {
- // The pipeline is already in the correct state. Do nothing.
+ // The pipeline is already in the correct state. Unblock the pad, and return.
g_mutex_unlock (player->mutex);
+ if (gst_pad_is_blocked (srcPad)) {
+ gst_pad_set_blocked_async(srcPad, FALSE, &pad_block_cb, player);
+ }
return;
}
@@ -108,6 +111,9 @@ pad_block_cb (GstPad *srcPad, gboolean blocked, gpointer user_data) {
if (player->replaygain_enabled) {
player->rgvolume = _bp_rgvolume_new (player);
+ if (!GST_IS_ELEMENT (player->rgvolume)) {
+ player->replaygain_enabled = FALSE;
+ }
} else {
gst_element_set_state (player->rgvolume, GST_STATE_NULL);
gst_bin_remove (GST_BIN (player->audiobin), player->rgvolume);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]