+2008-05-05 Sebastian Dröge <slomo@circular-chaos.org>
+
+ * gst/playback/gstplaybasebin.c: (set_audio_mute),
+ (set_active_source):
+ * gst/playback/gstplaybasebin.h:
+ * gst/playback/gstplaybin.c: (gst_play_bin_class_init),
+ (playbin_set_audio_mute):
+ Allow setting -1 as current-audio to mute the current audio stream,
+ similar to what is done for subtitles. Fixes bug #342294.
+
2008-05-05 Edward Hervey <edward.hervey at collabora co uk>
* gst-libs/gst/pbutils/descriptions.c: (formats):
klass->set_subtitles_visible (play_base_bin, visible);
}
+static void
+set_audio_mute (GstPlayBaseBin * play_base_bin, gboolean mute)
+{
+ GstPlayBaseBinClass *klass = GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin);
+
+ /* we use a vfunc for this since we don't have a reference to the
+ * textoverlay element, but playbin does */
+ if (klass != NULL && klass->set_audio_mute != NULL)
+ klass->set_audio_mute (play_base_bin, mute);
+}
+
/*
* Caller has group-lock held.
*/
set_subtitles_visible (play_base_bin, visible);
if (!visible)
return;
+ } else if (type == GST_STREAM_TYPE_AUDIO) {
+ gboolean mute = (source_num == -1);
+
+ set_audio_mute (play_base_bin, mute);
+
+ if (mute)
+ return;
}
sel = group->type[type - 1].selector;
void (*set_subtitles_visible) (GstPlayBaseBin *play_base_bin,
gboolean visible);
+ void (*set_audio_mute) (GstPlayBaseBin *play_base_bin,
+ gboolean mute);
};
GType gst_play_base_bin_get_type (void);
static void remove_sinks (GstPlayBin * play_bin);
static void playbin_set_subtitles_visible (GstPlayBaseBin * play_base_bin,
gboolean visible);
+static void playbin_set_audio_mute (GstPlayBaseBin * play_base_bin,
+ gboolean mute);
static void gst_play_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * spec);
playbasebin_klass->setup_output_pads = setup_sinks;
playbasebin_klass->set_subtitles_visible = playbin_set_subtitles_visible;
+ playbasebin_klass->set_audio_mute = playbin_set_audio_mute;
}
static void
}
}
+static void
+playbin_set_audio_mute (GstPlayBaseBin * play_base_bin, gboolean mute)
+{
+ GstPlayBin *playbin = GST_PLAY_BIN (play_base_bin);
+
+ if (playbin->volume_element) {
+ g_object_set (G_OBJECT (playbin->volume_element), "mute", mute, NULL);
+ }
+}
+
/* Send an event to our sinks until one of them works; don't then send to the
* remaining sinks (unlike GstBin)
*/