summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/play/gstplay.c12
-rw-r--r--gst-libs/gst/play/play.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/gst-libs/gst/play/gstplay.c b/gst-libs/gst/play/gstplay.c
index 7a0838ee..eb4d161c 100644
--- a/gst-libs/gst/play/gstplay.c
+++ b/gst-libs/gst/play/gstplay.c
@@ -304,8 +304,10 @@ gst_play_get_length_callback (GstPlay *play)
}
/* Audio first and then Video */
- q = gst_element_query (audio_sink_element, GST_QUERY_TOTAL, &format, &value);
- if (!q)
+ if (GST_IS_ELEMENT (audio_sink_element))
+ q = gst_element_query (audio_sink_element, GST_QUERY_TOTAL, &format,
+ &value);
+ if ( (!q) && (GST_IS_ELEMENT (video_sink_element)) )
q = gst_element_query (video_sink_element, GST_QUERY_TOTAL, &format,
&value);
@@ -647,6 +649,8 @@ gst_play_set_video_sink (GstPlay *play, GstElement *video_sink)
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
+ g_return_val_if_fail (video_sink != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (video_sink), FALSE);
/* We bring back the pipeline to READY */
if (GST_STATE (GST_ELEMENT (play)) != GST_STATE_READY)
@@ -703,6 +707,8 @@ gst_play_set_audio_sink (GstPlay *play, GstElement *audio_sink)
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
+ g_return_val_if_fail (audio_sink != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (audio_sink), FALSE);
/* We bring back the pipeline to READY */
if (GST_STATE (GST_ELEMENT (play)) != GST_STATE_READY)
@@ -767,6 +773,8 @@ gst_play_set_visualization (GstPlay *play, GstElement *vis_element)
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
+ g_return_val_if_fail (vis_element != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (vis_element), FALSE);
/* We bring back the pipeline to READY */
if (GST_STATE (GST_ELEMENT (play)) == GST_STATE_PLAYING) {
diff --git a/gst-libs/gst/play/play.c b/gst-libs/gst/play/play.c
index 7a0838ee..eb4d161c 100644
--- a/gst-libs/gst/play/play.c
+++ b/gst-libs/gst/play/play.c
@@ -304,8 +304,10 @@ gst_play_get_length_callback (GstPlay *play)
}
/* Audio first and then Video */
- q = gst_element_query (audio_sink_element, GST_QUERY_TOTAL, &format, &value);
- if (!q)
+ if (GST_IS_ELEMENT (audio_sink_element))
+ q = gst_element_query (audio_sink_element, GST_QUERY_TOTAL, &format,
+ &value);
+ if ( (!q) && (GST_IS_ELEMENT (video_sink_element)) )
q = gst_element_query (video_sink_element, GST_QUERY_TOTAL, &format,
&value);
@@ -647,6 +649,8 @@ gst_play_set_video_sink (GstPlay *play, GstElement *video_sink)
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
+ g_return_val_if_fail (video_sink != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (video_sink), FALSE);
/* We bring back the pipeline to READY */
if (GST_STATE (GST_ELEMENT (play)) != GST_STATE_READY)
@@ -703,6 +707,8 @@ gst_play_set_audio_sink (GstPlay *play, GstElement *audio_sink)
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
+ g_return_val_if_fail (audio_sink != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (audio_sink), FALSE);
/* We bring back the pipeline to READY */
if (GST_STATE (GST_ELEMENT (play)) != GST_STATE_READY)
@@ -767,6 +773,8 @@ gst_play_set_visualization (GstPlay *play, GstElement *vis_element)
g_return_val_if_fail (play != NULL, FALSE);
g_return_val_if_fail (GST_IS_PLAY (play), FALSE);
+ g_return_val_if_fail (vis_element != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (vis_element), FALSE);
/* We bring back the pipeline to READY */
if (GST_STATE (GST_ELEMENT (play)) == GST_STATE_PLAYING) {