Commit e01b8a62 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst-libs/gst/interfaces/mixer.c: Guard mixer interface functions against bogus arguments.

Original commit message from CVS:
* gst-libs/gst/interfaces/mixer.c: (gst_mixer_list_tracks),
(gst_mixer_set_volume), (gst_mixer_get_volume),
(gst_mixer_set_mute), (gst_mixer_set_option),
(gst_mixer_get_option), (gst_mixer_mute_toggled),
(gst_mixer_record_toggled), (gst_mixer_volume_changed),
(gst_mixer_option_changed):
Guard mixer interface functions against bogus arguments.
parent 9f9b8241
2006-10-13 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/interfaces/mixer.c: (gst_mixer_list_tracks),
(gst_mixer_set_volume), (gst_mixer_get_volume),
(gst_mixer_set_mute), (gst_mixer_set_option),
(gst_mixer_get_option), (gst_mixer_mute_toggled),
(gst_mixer_record_toggled), (gst_mixer_volume_changed),
(gst_mixer_option_changed):
Guard mixer interface functions against bogus arguments.
2006-10-12 Julien MOUTTE <julien@moutte.net>
 
* tests/examples/seek/seek.c: (do_seek), (start_seek), (stop_seek),
......@@ -136,7 +136,11 @@ gst_mixer_class_init (GstMixerClass * klass)
const GList *
gst_mixer_list_tracks (GstMixer * mixer)
{
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
GstMixerClass *klass;
g_return_val_if_fail (mixer != NULL, NULL);
klass = GST_MIXER_GET_CLASS (mixer);
if (klass->list_tracks) {
return klass->list_tracks (mixer);
......@@ -163,7 +167,13 @@ gst_mixer_list_tracks (GstMixer * mixer)
void
gst_mixer_set_volume (GstMixer * mixer, GstMixerTrack * track, gint * volumes)
{
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
GstMixerClass *klass;
g_return_if_fail (mixer != NULL);
g_return_if_fail (track != NULL);
g_return_if_fail (volumes != NULL);
klass = GST_MIXER_GET_CLASS (mixer);
if (klass->set_volume) {
klass->set_volume (mixer, track, volumes);
......@@ -184,7 +194,13 @@ gst_mixer_set_volume (GstMixer * mixer, GstMixerTrack * track, gint * volumes)
void
gst_mixer_get_volume (GstMixer * mixer, GstMixerTrack * track, gint * volumes)
{
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
GstMixerClass *klass;
g_return_if_fail (mixer != NULL);
g_return_if_fail (track != NULL);
g_return_if_fail (volumes != NULL);
klass = GST_MIXER_GET_CLASS (mixer);
if (klass->get_volume) {
klass->get_volume (mixer, track, volumes);
......@@ -211,7 +227,12 @@ gst_mixer_get_volume (GstMixer * mixer, GstMixerTrack * track, gint * volumes)
void
gst_mixer_set_mute (GstMixer * mixer, GstMixerTrack * track, gboolean mute)
{
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
GstMixerClass *klass;
g_return_if_fail (mixer != NULL);
g_return_if_fail (track != NULL);
klass = GST_MIXER_GET_CLASS (mixer);
if (klass->set_mute) {
klass->set_mute (mixer, track, mute);
......@@ -253,7 +274,12 @@ gst_mixer_set_record (GstMixer * mixer, GstMixerTrack * track, gboolean record)
void
gst_mixer_set_option (GstMixer * mixer, GstMixerOptions * opts, gchar * value)
{
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
GstMixerClass *klass;
g_return_if_fail (mixer != NULL);
g_return_if_fail (opts != NULL);
klass = GST_MIXER_GET_CLASS (mixer);
if (klass->set_option) {
klass->set_option (mixer, opts, value);
......@@ -273,7 +299,12 @@ gst_mixer_set_option (GstMixer * mixer, GstMixerOptions * opts, gchar * value)
const gchar *
gst_mixer_get_option (GstMixer * mixer, GstMixerOptions * opts)
{
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
GstMixerClass *klass;
g_return_val_if_fail (mixer != NULL, NULL);
g_return_val_if_fail (opts != NULL, NULL);
klass = GST_MIXER_GET_CLASS (mixer);
if (klass->get_option) {
return klass->get_option (mixer, opts);
......@@ -285,6 +316,9 @@ gst_mixer_get_option (GstMixer * mixer, GstMixerOptions * opts)
void
gst_mixer_mute_toggled (GstMixer * mixer, GstMixerTrack * track, gboolean mute)
{
g_return_if_fail (mixer != NULL);
g_return_if_fail (track != NULL);
g_signal_emit (G_OBJECT (mixer),
gst_mixer_signals[SIGNAL_MUTE_TOGGLED], 0, track, mute);
......@@ -295,6 +329,9 @@ void
gst_mixer_record_toggled (GstMixer * mixer,
GstMixerTrack * track, gboolean record)
{
g_return_if_fail (mixer != NULL);
g_return_if_fail (track != NULL);
g_signal_emit (G_OBJECT (mixer),
gst_mixer_signals[SIGNAL_RECORD_TOGGLED], 0, track, record);
......@@ -305,6 +342,9 @@ void
gst_mixer_volume_changed (GstMixer * mixer,
GstMixerTrack * track, gint * volumes)
{
g_return_if_fail (mixer != NULL);
g_return_if_fail (track != NULL);
g_signal_emit (G_OBJECT (mixer),
gst_mixer_signals[SIGNAL_VOLUME_CHANGED], 0, track, volumes);
......@@ -315,6 +355,9 @@ void
gst_mixer_option_changed (GstMixer * mixer,
GstMixerOptions * opts, gchar * value)
{
g_return_if_fail (mixer != NULL);
g_return_if_fail (opts != NULL);
g_signal_emit (G_OBJECT (mixer),
gst_mixer_signals[SIGNAL_OPTION_CHANGED], 0, opts, value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment