From 8f4359c6197f18c6b8dbea03e5536f7ab0ad09b2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 22 Jul 2004 16:44:58 +0000 Subject: More playback updates, attempt to fix things after the state change breakage. Original commit message from CVS: * examples/seeking/seek.c: (update_scale), (main): * gst/playback/gstdecodebin.c: (gst_decode_bin_get_type), (gst_decode_bin_class_init), (gst_decode_bin_is_dynamic), (gst_decode_bin_factory_filter), (compare_ranks), (print_feature), (gst_decode_bin_init), (gst_decode_bin_dispose), (find_compatibles), (close_pad_link), (try_to_link_1), (new_pad), (no_more_pads), (close_link), (type_found), (gst_decode_bin_set_property), (gst_decode_bin_get_property), (plugin_init): * gst/playback/gstplaybasebin.c: (gst_play_base_bin_get_type), (gst_play_base_bin_class_init), (gst_play_base_bin_init), (gst_play_base_bin_dispose), (queue_overrun), (gen_preroll_element), (remove_prerolls), (unknown_type), (no_more_pads), (new_stream), (setup_source), (gst_play_base_bin_set_property), (gst_play_base_bin_get_property), (play_base_eos), (gst_play_base_bin_change_state), (gst_play_base_bin_add_element), (gst_play_base_bin_remove_element), (gst_play_base_bin_mute_stream), (gst_play_base_bin_link_stream), (gst_play_base_bin_unlink_stream), (gst_play_base_bin_get_streaminfo): * gst/playback/gstplaybin.c: (gen_video_element), (gen_audio_element): * gst/playback/gststreaminfo.h: More playback updates, attempt to fix things after the state change breakage. --- examples/seeking/seek.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/seeking/seek.c b/examples/seeking/seek.c index fce17f3e..a274c105 100644 --- a/examples/seeking/seek.c +++ b/examples/seeking/seek.c @@ -755,6 +755,7 @@ update_scale (gpointer data) GstClock *clock; guint64 position; GstFormat format = GST_FORMAT_TIME; + gboolean res; duration = 0; clock = gst_bin_get_clock (GST_BIN (pipeline)); @@ -763,15 +764,23 @@ update_scale (gpointer data) if (seekable_elements) { GstElement *element = GST_ELEMENT (seekable_elements->data); - gst_element_query (element, GST_QUERY_TOTAL, &format, &duration); - gst_element_query (element, GST_QUERY_POSITION, &format, &position); + res = gst_element_query (element, GST_QUERY_TOTAL, &format, &duration); + if (!res) + duration = 0; + res = gst_element_query (element, GST_QUERY_POSITION, &format, &position); + if (!res) + position = 0; } } else { if (seekable_pads) { GstPad *pad = GST_PAD (seekable_pads->data); - gst_pad_query (pad, GST_QUERY_TOTAL, &format, &duration); - gst_pad_query (pad, GST_QUERY_POSITION, &format, &position); + res = gst_pad_query (pad, GST_QUERY_TOTAL, &format, &duration); + if (!res) + duration = 0; + res = gst_pad_query (pad, GST_QUERY_POSITION, &format, &position); + if (!res) + position = 0; } } -- cgit v1.2.1