summaryrefslogtreecommitdiffstats
path: root/examples/seeking
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2004-07-22 16:44:58 +0000
committerWim Taymans <wim.taymans@gmail.com>2004-07-22 16:44:58 +0000
commit8f4359c6197f18c6b8dbea03e5536f7ab0ad09b2 (patch)
tree862f9746d894dd2be728cb95965fe8f0e4b2cca7 /examples/seeking
parent996e75ecfe0539a10eb144a512e8868a0245f78c (diff)
downloadgst-plugins-bad-8f4359c6197f18c6b8dbea03e5536f7ab0ad09b2.tar.gz
gst-plugins-bad-8f4359c6197f18c6b8dbea03e5536f7ab0ad09b2.tar.bz2
gst-plugins-bad-8f4359c6197f18c6b8dbea03e5536f7ab0ad09b2.zip
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.
Diffstat (limited to 'examples/seeking')
-rw-r--r--examples/seeking/seek.c17
1 files changed, 13 insertions, 4 deletions
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;
}
}