More playback updates, attempt to fix things after the state change breakage.
authorWim Taymans <wim.taymans@gmail.com>
Thu, 22 Jul 2004 16:44:58 +0000 (16:44 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 22 Jul 2004 16:44:58 +0000 (16:44 +0000)
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.

ChangeLog
examples/seeking/seek.c

index 684ab438ec1786929301b721a5f81dc1339b5362..3b2cab7a09e209834a29ba2fd75a0a5f74b09bf5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2004-07-22  Wim Taymans  <wim@fluendo.com>
+
+       * 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.
+
 2004-07-22  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * gst/videoscale/videoscale.c: (gst_videoscale_planar411),
index fce17f3e7e79929a8d9f8338bebfffb9779e238d..a274c10548b07341487f8dd5c1fbec73e62c27f9 100644 (file)
@@ -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;
     }
   }